diff --git a/Lib/importlib/test/builtin/test_finder.py b/Lib/importlib/test/builtin/test_finder.py index 1f6274c0230..146538d891d 100644 --- a/Lib/importlib/test/builtin/test_finder.py +++ b/Lib/importlib/test/builtin/test_finder.py @@ -35,14 +35,14 @@ class FinderTests(abc.FinderTests): def test_failure(self): assert 'importlib' not in sys.builtin_module_names loader = machinery.BuiltinImporter.find_module('importlib') - self.assertIs(loader, None) + self.assertIsNone(loader) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with util.uncache(builtin_util.NAME): loader = machinery.BuiltinImporter.find_module(builtin_util.NAME, ['pkg']) - self.assertIs(loader, None) + self.assertIsNone(loader) diff --git a/Lib/importlib/test/builtin/test_loader.py b/Lib/importlib/test/builtin/test_loader.py index 357ec2621e2..8e186e71560 100644 --- a/Lib/importlib/test/builtin/test_loader.py +++ b/Lib/importlib/test/builtin/test_loader.py @@ -74,12 +74,12 @@ class InspectLoaderTests(unittest.TestCase): def test_get_code(self): # There is no code object. result = machinery.BuiltinImporter.get_code(builtin_util.NAME) - self.assertIs(result, None) + self.assertIsNone(result) def test_get_source(self): # There is no source. result = machinery.BuiltinImporter.get_source(builtin_util.NAME) - self.assertIs(result, None) + self.assertIsNone(result) def test_is_package(self): # Cannot be a package. diff --git a/Lib/importlib/test/extension/test_finder.py b/Lib/importlib/test/extension/test_finder.py index ef84884e027..1c6029291f2 100644 --- a/Lib/importlib/test/extension/test_finder.py +++ b/Lib/importlib/test/extension/test_finder.py @@ -36,7 +36,7 @@ class FinderTests(abc.FinderTests): pass 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? diff --git a/Lib/importlib/test/frozen/test_finder.py b/Lib/importlib/test/frozen/test_finder.py index a51d939ccc1..54c0c9072fd 100644 --- a/Lib/importlib/test/frozen/test_finder.py +++ b/Lib/importlib/test/frozen/test_finder.py @@ -35,7 +35,7 @@ class FinderTests(abc.FinderTests): def test_failure(self): loader = self.find('') - self.assertIs(loader, None) + self.assertIsNone(loader) def test_main(): diff --git a/Lib/importlib/test/frozen/test_loader.py b/Lib/importlib/test/frozen/test_loader.py index 87a479a63d1..4b8ec155543 100644 --- a/Lib/importlib/test/frozen/test_loader.py +++ b/Lib/importlib/test/frozen/test_loader.py @@ -93,7 +93,7 @@ class InspectLoaderTests(unittest.TestCase): def test_get_source(self): # Should always return None. result = machinery.FrozenImporter.get_source('__hello__') - self.assertIs(result, None) + self.assertIsNone(result) def test_is_package(self): # Should be able to tell what is a package. diff --git a/Lib/importlib/test/import_/test_meta_path.py b/Lib/importlib/test/import_/test_meta_path.py index 7f6d6dae01c..4d85f80e673 100644 --- a/Lib/importlib/test/import_/test_meta_path.py +++ b/Lib/importlib/test/import_/test_meta_path.py @@ -82,7 +82,7 @@ class CallSignature(unittest.TestCase): self.assertEqual(len(args), 2) self.assertEqual(len(kwargs), 0) self.assertEqual(args[0], mod_name) - self.assertIs(args[1], None) + self.assertIsNone(args[1]) def test_with_path(self): # [path set] diff --git a/Lib/importlib/test/import_/test_path.py b/Lib/importlib/test/import_/test_path.py index b8aeab12a9e..0c086ce147a 100644 --- a/Lib/importlib/test/import_/test_path.py +++ b/Lib/importlib/test/import_/test_path.py @@ -20,7 +20,7 @@ class FinderTests(unittest.TestCase): # Test None returned upon not finding a suitable finder. module = '' with util.import_state(): - self.assertIs(machinery.PathFinder.find_module(module), None) + self.assertIsNone(machinery.PathFinder.find_module(module)) def test_sys_path(self): # Test that sys.path is used when 'path' is None. diff --git a/Lib/importlib/test/source/test_finder.py b/Lib/importlib/test/source/test_finder.py index e1ef9387fd5..fa5d3567b58 100644 --- a/Lib/importlib/test/source/test_finder.py +++ b/Lib/importlib/test/source/test_finder.py @@ -115,7 +115,7 @@ class FinderTests(abc.FinderTests): def test_failure(self): with source_util.create_modules('blah') as mapping: nothing = self.import_(mapping['.root'], 'sdfsadsadf') - self.assertIs(nothing, None) + self.assertIsNone(nothing) def test_empty_string_for_dir(self): # The empty string from sys.path means to search in the cwd. diff --git a/Lib/importlib/test/test_locks.py b/Lib/importlib/test/test_locks.py index 7faff490ae5..d36b71eb18e 100644 --- a/Lib/importlib/test/test_locks.py +++ b/Lib/importlib/test/test_locks.py @@ -97,7 +97,7 @@ class LifetimeTests(unittest.TestCase): del lock support.gc_collect() self.assertNotIn(name, _bootstrap._module_locks) - self.assertIs(wr(), None) + self.assertIsNone(wr()) def test_all_locks(self): support.gc_collect()