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
b796e7dc
Commit
b796e7dc
authored
Jul 09, 2018
by
Sergey Fedoseev
Committed by
Serhiy Storchaka
Jul 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed several assertTrue() that were intended to be assertEqual(). (GH-8191)
Fixed also testing the "always" warning filter.
parent
c287545d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
9 deletions
+13
-9
Lib/ctypes/test/test_as_parameter.py
Lib/ctypes/test/test_as_parameter.py
+1
-1
Lib/test/test_pkg.py
Lib/test/test_pkg.py
+1
-1
Lib/test/test_socket.py
Lib/test/test_socket.py
+1
-1
Lib/test/test_support.py
Lib/test/test_support.py
+1
-1
Lib/test/test_tokenize.py
Lib/test/test_tokenize.py
+1
-1
Lib/test/test_warnings/__init__.py
Lib/test/test_warnings/__init__.py
+8
-4
No files found.
Lib/ctypes/test/test_as_parameter.py
View file @
b796e7dc
...
...
@@ -24,7 +24,7 @@ class BasicWrapTestCase(unittest.TestCase):
f
.
argtypes
=
[
c_byte
,
c_wchar
,
c_int
,
c_long
,
c_float
,
c_double
]
result
=
f
(
self
.
wrap
(
1
),
self
.
wrap
(
"x"
),
self
.
wrap
(
3
),
self
.
wrap
(
4
),
self
.
wrap
(
5.0
),
self
.
wrap
(
6.0
))
self
.
assertEqual
(
result
,
139
)
self
.
assert
True
(
type
(
result
),
int
)
self
.
assert
Is
(
type
(
result
),
int
)
def
test_pointers
(
self
):
f
=
dll
.
_testfunc_p_p
...
...
Lib/test/test_pkg.py
View file @
b796e7dc
...
...
@@ -138,7 +138,7 @@ class TestPkg(unittest.TestCase):
s
=
"""
from t2 import *
self.assert
True
(dir(), ['self', 'sub'])
self.assert
Equal
(dir(), ['self', 'sub'])
"""
self
.
run_code
(
s
)
...
...
Lib/test/test_socket.py
View file @
b796e7dc
...
...
@@ -5843,7 +5843,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
op
=
socket
.
ALG_OP_ENCRYPT
,
iv
=
iv
)
enc
=
op
.
recv
(
msglen
*
multiplier
)
self
.
assertEqual
(
len
(
enc
),
msglen
*
multiplier
)
self
.
assert
True
(
enc
[:
msglen
],
ciphertext
)
self
.
assert
Equal
(
enc
[:
msglen
],
ciphertext
)
op
,
_
=
algo
.
accept
()
with
op
:
...
...
Lib/test/test_support.py
View file @
b796e7dc
...
...
@@ -264,7 +264,7 @@ class TestSupport(unittest.TestCase):
with
support
.
temp_cwd
(
name
=
TESTFN
):
self
.
assertEqual
(
os
.
path
.
basename
(
os
.
getcwd
()),
TESTFN
)
self
.
assertFalse
(
os
.
path
.
exists
(
TESTFN
))
self
.
assert
True
(
os
.
path
.
basename
(
os
.
getcwd
()
),
here
)
self
.
assert
Equal
(
os
.
getcwd
(
),
here
)
def
test_temp_cwd__name_none
(
self
):
...
...
Lib/test/test_tokenize.py
View file @
b796e7dc
...
...
@@ -1360,7 +1360,7 @@ class TestTokenize(TestCase):
tokenize_module
.
detect_encoding
=
orig_detect_encoding
tokenize_module
.
_tokenize
=
orig__tokenize
self
.
assert
True
(
encoding_used
,
encoding
)
self
.
assert
Equal
(
encoding_used
,
encoding
)
def
test_oneline_defs
(
self
):
buf
=
[]
...
...
Lib/test/test_warnings/__init__.py
View file @
b796e7dc
...
...
@@ -148,10 +148,14 @@ class FilterTests(BaseTest):
self
.
module
.
resetwarnings
()
self
.
module
.
filterwarnings
(
"always"
,
category
=
UserWarning
)
message
=
"FilterTests.test_always"
self
.
module
.
warn
(
message
,
UserWarning
)
self
.
assertTrue
(
message
,
w
[
-
1
].
message
)
self
.
module
.
warn
(
message
,
UserWarning
)
self
.
assertTrue
(
w
[
-
1
].
message
,
message
)
def
f
():
self
.
module
.
warn
(
message
,
UserWarning
)
f
()
self
.
assertEqual
(
len
(
w
),
1
)
self
.
assertEqual
(
w
[
-
1
].
message
.
args
[
0
],
message
)
f
()
self
.
assertEqual
(
len
(
w
),
2
)
self
.
assertEqual
(
w
[
-
1
].
message
.
args
[
0
],
message
)
def
test_always_after_default
(
self
):
with
original_warnings
.
catch_warnings
(
record
=
True
,
...
...
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