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
38601955
Commit
38601955
authored
Jun 28, 2012
by
Eric V. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use assertIsNone. Thanks Terry Reedy.
parent
510bf070
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
11 deletions
+11
-11
Lib/importlib/test/builtin/test_finder.py
Lib/importlib/test/builtin/test_finder.py
+2
-2
Lib/importlib/test/builtin/test_loader.py
Lib/importlib/test/builtin/test_loader.py
+2
-2
Lib/importlib/test/extension/test_finder.py
Lib/importlib/test/extension/test_finder.py
+1
-1
Lib/importlib/test/frozen/test_finder.py
Lib/importlib/test/frozen/test_finder.py
+1
-1
Lib/importlib/test/frozen/test_loader.py
Lib/importlib/test/frozen/test_loader.py
+1
-1
Lib/importlib/test/import_/test_meta_path.py
Lib/importlib/test/import_/test_meta_path.py
+1
-1
Lib/importlib/test/import_/test_path.py
Lib/importlib/test/import_/test_path.py
+1
-1
Lib/importlib/test/source/test_finder.py
Lib/importlib/test/source/test_finder.py
+1
-1
Lib/importlib/test/test_locks.py
Lib/importlib/test/test_locks.py
+1
-1
No files found.
Lib/importlib/test/builtin/test_finder.py
View file @
38601955
...
@@ -35,14 +35,14 @@ class FinderTests(abc.FinderTests):
...
@@ -35,14 +35,14 @@ class FinderTests(abc.FinderTests):
def
test_failure
(
self
):
def
test_failure
(
self
):
assert
'importlib'
not
in
sys
.
builtin_module_names
assert
'importlib'
not
in
sys
.
builtin_module_names
loader
=
machinery
.
BuiltinImporter
.
find_module
(
'importlib'
)
loader
=
machinery
.
BuiltinImporter
.
find_module
(
'importlib'
)
self
.
assertIs
(
loader
,
None
)
self
.
assertIs
None
(
loader
)
def
test_ignore_path
(
self
):
def
test_ignore_path
(
self
):
# The value for 'path' should always trigger a failed import.
# The value for 'path' should always trigger a failed import.
with
util
.
uncache
(
builtin_util
.
NAME
):
with
util
.
uncache
(
builtin_util
.
NAME
):
loader
=
machinery
.
BuiltinImporter
.
find_module
(
builtin_util
.
NAME
,
loader
=
machinery
.
BuiltinImporter
.
find_module
(
builtin_util
.
NAME
,
[
'pkg'
])
[
'pkg'
])
self
.
assertIs
(
loader
,
None
)
self
.
assertIs
None
(
loader
)
...
...
Lib/importlib/test/builtin/test_loader.py
View file @
38601955
...
@@ -74,12 +74,12 @@ class InspectLoaderTests(unittest.TestCase):
...
@@ -74,12 +74,12 @@ class InspectLoaderTests(unittest.TestCase):
def
test_get_code
(
self
):
def
test_get_code
(
self
):
# There is no code object.
# There is no code object.
result
=
machinery
.
BuiltinImporter
.
get_code
(
builtin_util
.
NAME
)
result
=
machinery
.
BuiltinImporter
.
get_code
(
builtin_util
.
NAME
)
self
.
assertIs
(
result
,
None
)
self
.
assertIs
None
(
result
)
def
test_get_source
(
self
):
def
test_get_source
(
self
):
# There is no source.
# There is no source.
result
=
machinery
.
BuiltinImporter
.
get_source
(
builtin_util
.
NAME
)
result
=
machinery
.
BuiltinImporter
.
get_source
(
builtin_util
.
NAME
)
self
.
assertIs
(
result
,
None
)
self
.
assertIs
None
(
result
)
def
test_is_package
(
self
):
def
test_is_package
(
self
):
# Cannot be a package.
# Cannot be a package.
...
...
Lib/importlib/test/extension/test_finder.py
View file @
38601955
...
@@ -36,7 +36,7 @@ class FinderTests(abc.FinderTests):
...
@@ -36,7 +36,7 @@ class FinderTests(abc.FinderTests):
pass
pass
def
test_failure
(
self
):
def
test_failure
(
self
):
self
.
assertIs
(
self
.
find_module
(
'asdfjkl;'
),
None
)
self
.
assertIs
None
(
self
.
find_module
(
'asdfjkl;'
)
)
# XXX Raise an exception if someone tries to use the 'path' argument?
# XXX Raise an exception if someone tries to use the 'path' argument?
...
...
Lib/importlib/test/frozen/test_finder.py
View file @
38601955
...
@@ -35,7 +35,7 @@ class FinderTests(abc.FinderTests):
...
@@ -35,7 +35,7 @@ class FinderTests(abc.FinderTests):
def
test_failure
(
self
):
def
test_failure
(
self
):
loader
=
self
.
find
(
'<not real>'
)
loader
=
self
.
find
(
'<not real>'
)
self
.
assertIs
(
loader
,
None
)
self
.
assertIs
None
(
loader
)
def
test_main
():
def
test_main
():
...
...
Lib/importlib/test/frozen/test_loader.py
View file @
38601955
...
@@ -93,7 +93,7 @@ class InspectLoaderTests(unittest.TestCase):
...
@@ -93,7 +93,7 @@ class InspectLoaderTests(unittest.TestCase):
def
test_get_source
(
self
):
def
test_get_source
(
self
):
# Should always return None.
# Should always return None.
result
=
machinery
.
FrozenImporter
.
get_source
(
'__hello__'
)
result
=
machinery
.
FrozenImporter
.
get_source
(
'__hello__'
)
self
.
assertIs
(
result
,
None
)
self
.
assertIs
None
(
result
)
def
test_is_package
(
self
):
def
test_is_package
(
self
):
# Should be able to tell what is a package.
# Should be able to tell what is a package.
...
...
Lib/importlib/test/import_/test_meta_path.py
View file @
38601955
...
@@ -82,7 +82,7 @@ class CallSignature(unittest.TestCase):
...
@@ -82,7 +82,7 @@ class CallSignature(unittest.TestCase):
self
.
assertEqual
(
len
(
args
),
2
)
self
.
assertEqual
(
len
(
args
),
2
)
self
.
assertEqual
(
len
(
kwargs
),
0
)
self
.
assertEqual
(
len
(
kwargs
),
0
)
self
.
assertEqual
(
args
[
0
],
mod_name
)
self
.
assertEqual
(
args
[
0
],
mod_name
)
self
.
assertIs
(
args
[
1
],
None
)
self
.
assertIs
None
(
args
[
1
]
)
def
test_with_path
(
self
):
def
test_with_path
(
self
):
# [path set]
# [path set]
...
...
Lib/importlib/test/import_/test_path.py
View file @
38601955
...
@@ -20,7 +20,7 @@ class FinderTests(unittest.TestCase):
...
@@ -20,7 +20,7 @@ class FinderTests(unittest.TestCase):
# Test None returned upon not finding a suitable finder.
# Test None returned upon not finding a suitable finder.
module
=
'<test module>'
module
=
'<test module>'
with
util
.
import_state
():
with
util
.
import_state
():
self
.
assertIs
(
machinery
.
PathFinder
.
find_module
(
module
),
None
)
self
.
assertIs
None
(
machinery
.
PathFinder
.
find_module
(
module
)
)
def
test_sys_path
(
self
):
def
test_sys_path
(
self
):
# Test that sys.path is used when 'path' is None.
# Test that sys.path is used when 'path' is None.
...
...
Lib/importlib/test/source/test_finder.py
View file @
38601955
...
@@ -115,7 +115,7 @@ class FinderTests(abc.FinderTests):
...
@@ -115,7 +115,7 @@ class FinderTests(abc.FinderTests):
def
test_failure
(
self
):
def
test_failure
(
self
):
with
source_util
.
create_modules
(
'blah'
)
as
mapping
:
with
source_util
.
create_modules
(
'blah'
)
as
mapping
:
nothing
=
self
.
import_
(
mapping
[
'.root'
],
'sdfsadsadf'
)
nothing
=
self
.
import_
(
mapping
[
'.root'
],
'sdfsadsadf'
)
self
.
assertIs
(
nothing
,
None
)
self
.
assertIs
None
(
nothing
)
def
test_empty_string_for_dir
(
self
):
def
test_empty_string_for_dir
(
self
):
# The empty string from sys.path means to search in the cwd.
# The empty string from sys.path means to search in the cwd.
...
...
Lib/importlib/test/test_locks.py
View file @
38601955
...
@@ -97,7 +97,7 @@ class LifetimeTests(unittest.TestCase):
...
@@ -97,7 +97,7 @@ class LifetimeTests(unittest.TestCase):
del
lock
del
lock
support
.
gc_collect
()
support
.
gc_collect
()
self
.
assertNotIn
(
name
,
_bootstrap
.
_module_locks
)
self
.
assertNotIn
(
name
,
_bootstrap
.
_module_locks
)
self
.
assertIs
(
wr
(),
None
)
self
.
assertIs
None
(
wr
()
)
def
test_all_locks
(
self
):
def
test_all_locks
(
self
):
support
.
gc_collect
()
support
.
gc_collect
()
...
...
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