Skip to content

Commit 6d3d8f3

Browse files
committed
Update test_py_config_isoloated_per_interpreter()
1 parent 47932ff commit 6d3d8f3

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Lib/test/test_capi/test_misc.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,22 +2147,19 @@ def test_py_config_isoloated_per_interpreter(self):
21472147
# This test could verify ANY config value, it just happens to have been
21482148
# written around the time of int_max_str_digits. Refactoring is okay.
21492149
code = """if 1:
2150-
import sys, _testinternalcapi
2150+
import sys, _testcapi
21512151
21522152
# Any config value would do, this happens to be the one being
21532153
# double checked at the time this test was written.
2154-
config = _testinternalcapi.get_config()
2155-
config['int_max_str_digits'] = 55555
2156-
config['parse_argv'] = 0
2157-
_testinternalcapi.set_config(config)
2158-
sub_value = _testinternalcapi.get_config()['int_max_str_digits']
2154+
_testcapi.config_set('int_max_str_digits', 55555)
2155+
sub_value = _testcapi.config_get('int_max_str_digits')
21592156
assert sub_value == 55555, sub_value
21602157
"""
2161-
before_config = _testinternalcapi.get_config()
2162-
assert before_config['int_max_str_digits'] != 55555
2158+
before_config = _testcapi.config_get('int_max_str_digits')
2159+
assert before_config != 55555
21632160
self.assertEqual(support.run_in_subinterp(code), 0,
21642161
'subinterp code failure, check stderr.')
2165-
after_config = _testinternalcapi.get_config()
2162+
after_config = _testcapi.config_get('int_max_str_digits')
21662163
self.assertIsNot(
21672164
before_config, after_config,
21682165
"Expected get_config() to return a new dict on each call")

0 commit comments

Comments
 (0)