pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/fd085a411ed2ccc9bde2338cf50068bc7f213ece

55097560d244c08.css" /> gh-121359: make clean environment (no PYTHON* vars) for test_pyrepl.T… · python/cpython@fd085a4 · GitHub
Skip to content

Commit fd085a4

Browse files
skirpichevambv
andauthored
gh-121359: make clean environment (no PYTHON* vars) for test_pyrepl.TestMain (GH-121672)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent e904300 commit fd085a4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,19 @@ def test_bracketed_paste_single_line(self):
884884

885885
@skipUnless(pty, "requires pty")
886886
class TestMain(TestCase):
887+
def setUp(self):
888+
# Cleanup from PYTHON* variables to isolate from local
889+
# user settings, see #121359. Such variables should be
890+
# added later in test methods to patched os.environ.
891+
clean_env = os.environ.copy()
892+
for k in clean_env.copy():
893+
if k.startswith("PYTHON"):
894+
clean_env.pop(k)
895+
896+
patcher = patch('os.environ', new=clean_env)
897+
self.addCleanup(patcher.stop)
898+
patcher.start()
899+
887900
@force_not_colorized
888901
def test_exposed_globals_in_repl(self):
889902
pre = "['__annotations__', '__builtins__'"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy