]> granicus.if.org Git - python/commitdiff
simplify StartupImportTests (GH-13096)
authorInada Naoki <songofacandy@gmail.com>
Sun, 5 May 2019 09:06:30 +0000 (18:06 +0900)
committerGitHub <noreply@github.com>
Sun, 5 May 2019 09:06:30 +0000 (18:06 +0900)
_osx_support and copyreg are not imported from site on macOS for now.

Lib/test/test_site.py

index 8643da0540f37bc426181d69d4ff6f22df7caa4b..41c4229919507b52d0c0e76639918bd70f91ba7d 100644 (file)
@@ -526,15 +526,15 @@ class StartupImportTests(unittest.TestCase):
 
         # http://bugs.python.org/issue19205
         re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
-        # _osx_support uses the re module in many placs
-        if sys.platform != 'darwin':
-            self.assertFalse(modules.intersection(re_mods), stderr)
+        self.assertFalse(modules.intersection(re_mods), stderr)
+
         # http://bugs.python.org/issue9548
         self.assertNotIn('locale', modules, stderr)
-        if sys.platform != 'darwin':
-            # http://bugs.python.org/issue19209
-            self.assertNotIn('copyreg', modules, stderr)
-        # http://bugs.python.org/issue19218>
+
+        # http://bugs.python.org/issue19209
+        self.assertNotIn('copyreg', modules, stderr)
+
+        # http://bugs.python.org/issue19218
         collection_mods = {'_collections', 'collections', 'functools',
                            'heapq', 'itertools', 'keyword', 'operator',
                            'reprlib', 'types', 'weakref'