Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8e79e6e5
Commit
8e79e6e5
authored
Feb 19, 2019
by
Serhiy Storchaka
Committed by
GitHub
Feb 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix syntax warnings in tests introduced in bpo-15248. (GH-11932)
parent
e7a4bb55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
Lib/test/test_bytes.py
Lib/test/test_bytes.py
+5
-3
Lib/test/test_extcall.py
Lib/test/test_extcall.py
+3
-2
Lib/test/test_tuple.py
Lib/test/test_tuple.py
+2
-1
No files found.
Lib/test/test_bytes.py
View file @
8e79e6e5
...
@@ -852,9 +852,10 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
...
@@ -852,9 +852,10 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
type2test
=
bytes
type2test
=
bytes
def
test_getitem_error
(
self
):
def
test_getitem_error
(
self
):
b
=
b'python'
msg
=
"byte indices must be integers or slices"
msg
=
"byte indices must be integers or slices"
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
b
'python'
[
'a'
]
b
[
'a'
]
def
test_buffer_is_readonly
(
self
):
def
test_buffer_is_readonly
(
self
):
fd
=
os
.
open
(
__file__
,
os
.
O_RDONLY
)
fd
=
os
.
open
(
__file__
,
os
.
O_RDONLY
)
...
@@ -1042,14 +1043,15 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
...
@@ -1042,14 +1043,15 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
type2test
=
bytearray
type2test
=
bytearray
def
test_getitem_error
(
self
):
def
test_getitem_error
(
self
):
b
=
bytearray
(
b'python'
)
msg
=
"bytearray indices must be integers or slices"
msg
=
"bytearray indices must be integers or slices"
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
b
ytearray
(
b'python'
)
[
'a'
]
b
[
'a'
]
def
test_setitem_error
(
self
):
def
test_setitem_error
(
self
):
b
=
bytearray
(
b'python'
)
msg
=
"bytearray indices must be integers or slices"
msg
=
"bytearray indices must be integers or slices"
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
b
=
bytearray
(
b'python'
)
b
[
'a'
]
=
"python"
b
[
'a'
]
=
"python"
def
test_nohash
(
self
):
def
test_nohash
(
self
):
...
...
Lib/test/test_extcall.py
View file @
8e79e6e5
...
@@ -264,7 +264,8 @@ What about willful misconduct?
...
@@ -264,7 +264,8 @@ What about willful misconduct?
...
...
TypeError: dir() argument after * must be an iterable, not function
TypeError: dir() argument after * must be an iterable, not function
>>> None(*h)
>>> nothing = None
>>> nothing(*h)
Traceback (most recent call last):
Traceback (most recent call last):
...
...
TypeError: NoneType object argument after * must be an iterable,
\
TypeError: NoneType object argument after * must be an iterable,
\
...
@@ -305,7 +306,7 @@ not function
...
@@ -305,7 +306,7 @@ not function
...
...
TypeError: dir() argument after ** must be a mapping, not function
TypeError: dir() argument after ** must be a mapping, not function
>>>
None
(**h)
>>>
nothing
(**h)
Traceback (most recent call last):
Traceback (most recent call last):
...
...
TypeError: NoneType object argument after ** must be a mapping,
\
TypeError: NoneType object argument after ** must be a mapping,
\
...
...
Lib/test/test_tuple.py
View file @
8e79e6e5
...
@@ -19,9 +19,10 @@ class TupleTest(seq_tests.CommonTest):
...
@@ -19,9 +19,10 @@ class TupleTest(seq_tests.CommonTest):
type2test
=
tuple
type2test
=
tuple
def
test_getitem_error
(
self
):
def
test_getitem_error
(
self
):
t
=
()
msg
=
"tuple indices must be integers or slices"
msg
=
"tuple indices must be integers or slices"
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
with
self
.
assertRaisesRegex
(
TypeError
,
msg
):
()
[
'a'
]
t
[
'a'
]
def
test_constructors
(
self
):
def
test_constructors
(
self
):
super
().
test_constructors
()
super
().
test_constructors
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment