File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -409,14 +409,9 @@ def test_write_read_limited_history(self):
409409
410410 @requires_subprocess ()
411411 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 )
412+ original_env = dict (os .environ )
413+ os .reload_environ ()
414+ self .assertEqual (dict (os .environ ), original_env )
420415
421416
422417@unittest .skipUnless (support .Py_GIL_DISABLED , 'these tests can only possibly fail with GIL disabled' )
You can’t perform that action at this time.
0 commit comments