Commit f0b366a8 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-35313: Cleanup test_embed.py (GH-10716)

* Remove an unused import.
* Move get_expected_config() call to check_config() to ease backport
  to Python 3.7.
parent a6537fb7
...@@ -408,7 +408,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ...@@ -408,7 +408,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
code = textwrap.dedent(''' code = textwrap.dedent('''
import json import json
import locale
import sys import sys
data = { data = {
...@@ -449,8 +448,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ...@@ -449,8 +448,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
expected[key] = config[key] expected[key] = config[key]
return expected return expected
def check_core_config(self, config, expected, env): def check_core_config(self, config, expected):
expected = self.get_expected_config(expected, env)
core_config = dict(config['core_config']) core_config = dict(config['core_config'])
for key in self.UNTESTED_CORE_CONFIG: for key in self.UNTESTED_CORE_CONFIG:
core_config.pop(key, None) core_config.pop(key, None)
...@@ -485,7 +483,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ...@@ -485,7 +483,8 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
# Ignore err # Ignore err
config = json.loads(out) 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_main_config(config)
self.check_global_config(config) self.check_global_config(config)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment