diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-07 11:09:43 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-07-07 11:09:43 (GMT) |
commit | f2c4ba120767e0e627844c2d8397462b5b2b86ca (patch) | |
tree | b11b1a21abe2690d53f980e821d13660a82f63ae /Lib/test/test_importlib | |
parent | cde9d1ee2f7a5ed930f917c7a0f26c9021c43317 (diff) | |
parent | 344f8316fd52205b19689dbdf44cfcfb338d127e (diff) | |
download | cpython-f2c4ba120767e0e627844c2d8397462b5b2b86ca.zip cpython-f2c4ba120767e0e627844c2d8397462b5b2b86ca.tar.gz cpython-f2c4ba120767e0e627844c2d8397462b5b2b86ca.tar.bz2 |
Issue #19593: Use specific asserts in importlib tests.
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r-- | Lib/test/test_importlib/builtin/test_loader.py | 2 | ||||
-rw-r--r-- | Lib/test/test_importlib/import_/test_fromlist.py | 2 | ||||
-rw-r--r-- | Lib/test/test_importlib/import_/test_meta_path.py | 2 | ||||
-rw-r--r-- | Lib/test/test_importlib/test_abc.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_importlib/builtin/test_loader.py b/Lib/test/test_importlib/builtin/test_loader.py index eaee025..1684ab6 100644 --- a/Lib/test/test_importlib/builtin/test_loader.py +++ b/Lib/test/test_importlib/builtin/test_loader.py @@ -88,7 +88,7 @@ class InspectLoaderTests: def test_is_package(self): # Cannot be a package. result = self.machinery.BuiltinImporter.is_package(util.BUILTINS.good_name) - self.assertTrue(not result) + self.assertFalse(result) @unittest.skipIf(util.BUILTINS.bad_name is None, 'all modules are built in') def test_not_builtin(self): diff --git a/Lib/test/test_importlib/import_/test_fromlist.py b/Lib/test/test_importlib/import_/test_fromlist.py index 8993226..8045465 100644 --- a/Lib/test/test_importlib/import_/test_fromlist.py +++ b/Lib/test/test_importlib/import_/test_fromlist.py @@ -62,7 +62,7 @@ class HandlingFromlist: with util.import_state(meta_path=[importer]): module = self.__import__('module', fromlist=['non_existent']) self.assertEqual(module.__name__, 'module') - self.assertTrue(not hasattr(module, 'non_existent')) + self.assertFalse(hasattr(module, 'non_existent')) def test_module_from_package(self): # [module] diff --git a/Lib/test/test_importlib/import_/test_meta_path.py b/Lib/test/test_importlib/import_/test_meta_path.py index 47a603c..c452cdd 100644 --- a/Lib/test/test_importlib/import_/test_meta_path.py +++ b/Lib/test/test_importlib/import_/test_meta_path.py @@ -97,7 +97,7 @@ class CallSignature: args = log[1][0] kwargs = log[1][1] # Assuming all arguments are positional. - self.assertTrue(not kwargs) + self.assertFalse(kwargs) self.assertEqual(args[0], mod_name) self.assertIs(args[1], path) diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index 66a8d7b..d4bf915 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -784,7 +784,7 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness): warnings.simplefilter('ignore', DeprecationWarning) module = self.loader.load_module(self.name) self.verify_module(module) - self.assertTrue(not hasattr(module, '__path__')) + self.assertFalse(hasattr(module, '__path__')) def test_get_source_encoding(self): # Source is considered encoded in UTF-8 by default unless otherwise |