]> granicus.if.org Git - python/commitdiff
bpo-35313: Cleanup test_embed.py (GH-10716)
authorVictor Stinner <vstinner@redhat.com>
Mon, 26 Nov 2018 11:37:34 +0000 (12:37 +0100)
committerGitHub <noreply@github.com>
Mon, 26 Nov 2018 11:37:34 +0000 (12:37 +0100)
* Remove an unused import.
* Move get_expected_config() call to check_config() to ease backport
  to Python 3.7.

Lib/test/test_embed.py

index b6c25e3f7eda3d9f8e2c4e84024a053cb0a93394..d35b9f4d5a2f2fd4698971da350f4e22735cfae6 100644 (file)
@@ -408,7 +408,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
 
         code = textwrap.dedent('''
             import json
-            import locale
             import sys
 
             data = {
@@ -449,8 +448,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
                 expected[key] = config[key]
         return expected
 
-    def check_core_config(self, config, expected, env):
-        expected = self.get_expected_config(expected, env)
+    def check_core_config(self, config, expected):
         core_config = dict(config['core_config'])
         for key in self.UNTESTED_CORE_CONFIG:
             core_config.pop(key, None)
@@ -485,7 +483,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
         # Ignore err
         config = json.loads(out)
 
-        self.check_core_config(config, expected, env)
+        expected = self.get_expected_config(expected, env)
+        self.check_core_config(config, expected)
         self.check_main_config(config)
         self.check_global_config(config)