File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ def test_package_over_module(self):
3535 def test_failure (self ):
3636 assert 'importlib' not in sys .builtin_module_names
3737 loader = machinery .BuiltinImporter .find_module ('importlib' )
38- self .assertIs (loader , None )
38+ self .assertIsNone (loader )
3939
4040 def test_ignore_path (self ):
4141 # The value for 'path' should always trigger a failed import.
4242 with util .uncache (builtin_util .NAME ):
4343 loader = machinery .BuiltinImporter .find_module (builtin_util .NAME ,
4444 ['pkg' ])
45- self .assertIs (loader , None )
45+ self .assertIsNone (loader )
4646
4747
4848
Original file line number Diff line number Diff line change @@ -74,12 +74,12 @@ class InspectLoaderTests(unittest.TestCase):
7474 def test_get_code (self ):
7575 # There is no code object.
7676 result = machinery .BuiltinImporter .get_code (builtin_util .NAME )
77- self .assertIs (result , None )
77+ self .assertIsNone (result )
7878
7979 def test_get_source (self ):
8080 # There is no source.
8181 result = machinery .BuiltinImporter .get_source (builtin_util .NAME )
82- self .assertIs (result , None )
82+ self .assertIsNone (result )
8383
8484 def test_is_package (self ):
8585 # Cannot be a package.
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def test_package_over_module(self):
3636 pass
3737
3838 def test_failure (self ):
39- self .assertIs (self .find_module ('asdfjkl;' ), None )
39+ self .assertIsNone (self .find_module ('asdfjkl;' ))
4040
4141 # XXX Raise an exception if someone tries to use the 'path' argument?
4242
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def test_package_over_module(self):
3535
3636 def test_failure (self ):
3737 loader = self .find ('<not real>' )
38- self .assertIs (loader , None )
38+ self .assertIsNone (loader )
3939
4040
4141def test_main ():
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ def test_get_code(self):
9393 def test_get_source (self ):
9494 # Should always return None.
9595 result = machinery .FrozenImporter .get_source ('__hello__' )
96- self .assertIs (result , None )
96+ self .assertIsNone (result )
9797
9898 def test_is_package (self ):
9999 # Should be able to tell what is a package.
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def test_no_path(self):
8282 self .assertEqual (len (args ), 2 )
8383 self .assertEqual (len (kwargs ), 0 )
8484 self .assertEqual (args [0 ], mod_name )
85- self .assertIs (args [1 ], None )
85+ self .assertIsNone (args [1 ])
8686
8787 def test_with_path (self ):
8888 # [path set]
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def test_failure(self):
2020 # Test None returned upon not finding a suitable finder.
2121 module = '<test module>'
2222 with util .import_state ():
23- self .assertIs (machinery .PathFinder .find_module (module ), None )
23+ self .assertIsNone (machinery .PathFinder .find_module (module ))
2424
2525 def test_sys_path (self ):
2626 # Test that sys.path is used when 'path' is None.
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def test_package_over_module(self):
115115 def test_failure (self ):
116116 with source_util .create_modules ('blah' ) as mapping :
117117 nothing = self .import_ (mapping ['.root' ], 'sdfsadsadf' )
118- self .assertIs (nothing , None )
118+ self .assertIsNone (nothing )
119119
120120 def test_empty_string_for_dir (self ):
121121 # The empty string from sys.path means to search in the cwd.
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ def test_lock_lifetime(self):
9797 del lock
9898 support .gc_collect ()
9999 self .assertNotIn (name , _bootstrap ._module_locks )
100- self .assertIs (wr (), None )
100+ self .assertIsNone (wr ())
101101
102102 def test_all_locks (self ):
103103 support .gc_collect ()
You can’t perform that action at this time.
0 commit comments