We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3159919 commit f14a8d6Copy full SHA for f14a8d6
1 file changed
Lib/test/test_readline.py
@@ -409,14 +409,9 @@ def test_write_read_limited_history(self):
409
410
@requires_subprocess()
411
def test_environment_is_not_modified(self):
412
- env_output = subprocess.check_output(["env"])
413
- env_lines = env_output.decode('utf-8', 'surrogateescape').splitlines()
414
- current_env = dict([line.split('=', 1) for line in env_lines])
415
-
416
- changes = {k for k in set(os.environ).union(current_env)
417
- if os.getenv(k) != current_env.get(k)}
418
419
- self.assertEqual(len(changes), 0)
+ original_env = dict(os.environ)
+ os.reload_environ()
+ self.assertEqual(dict(os.environ), original_env)
420
421
422
@unittest.skipUnless(support.Py_GIL_DISABLED, 'these tests can only possibly fail with GIL disabled')
0 commit comments