]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
simplify StartupImportTests (GH-13096)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 5 May 2019 09:25:16 +0000 (02:25 -0700)
committerGitHub <noreply@github.com>
Sun, 5 May 2019 09:25:16 +0000 (02:25 -0700)
_osx_support and copyreg are not imported from site on macOS for now.
(cherry picked from commit c4d92c8ada7ecfc479ebb1dd4a819c9202155970)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Lib/test/test_site.py

index 655a12ddd1654c1acb11a7c5e64b6f02b819a9f2..568f81da40f3aae228978512266c5870751bdd2e 100644 (file)
@@ -518,15 +518,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'