Skip to content

Commit 8bbc1cf

Browse files
committed
Add test
1 parent 775ae4a commit 8bbc1cf

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/test/test_readline.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,15 @@ def test_write_read_limited_history(self):
405405
# So, we've only tested that the read did not fail.
406406
# See TestHistoryManipulation for the full test.
407407

408+
def test_environment_is_not_modified(self):
409+
# os.environ contains enviroment at the time "os" module was loaded, so
410+
# before the "readline" module is loaded.
411+
original_env = dict(os.environ)
412+
413+
# Force refresh of os.environ and make sure it is the same as before the
414+
# refresh.
415+
os.reload_environ()
416+
self.assertEqual(dict(os.environ), original_env)
408417

409418
@unittest.skipUnless(support.Py_GIL_DISABLED, 'these tests can only possibly fail with GIL disabled')
410419
class FreeThreadingTest(unittest.TestCase):

0 commit comments

Comments
 (0)