Commit 38601955 authored by Eric V. Smith's avatar Eric V. Smith

Use assertIsNone. Thanks Terry Reedy.

parent 510bf070
...@@ -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.assertIsNone(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.assertIsNone(loader)
......
...@@ -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.assertIsNone(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.assertIsNone(result)
def test_is_package(self): def test_is_package(self):
# Cannot be a package. # Cannot be a package.
......
...@@ -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.assertIsNone(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?
......
...@@ -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.assertIsNone(loader)
def test_main(): def test_main():
......
...@@ -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.assertIsNone(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.
......
...@@ -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.assertIsNone(args[1])
def test_with_path(self): def test_with_path(self):
# [path set] # [path set]
......
...@@ -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.assertIsNone(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.
......
...@@ -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.assertIsNone(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.
......
...@@ -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.assertIsNone(wr())
def test_all_locks(self): def test_all_locks(self):
support.gc_collect() support.gc_collect()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment