diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-01-12 11:53:09 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-01-12 11:53:09 +0100 |
commit | 12c4aba1a0fbd934a66d6b97c29c36d7de14e755 (patch) | |
tree | 88abccf4fa8af51ad05820016fe26921e84e5cc9 /Lib/test | |
parent | 3159b33a956141c209113c4be99fe82b60024dd1 (diff) | |
parent | 9b8dcc6b1c18d5539735b61004d2e84b3e26cc8f (diff) | |
download | cpython-git-12c4aba1a0fbd934a66d6b97c29c36d7de14e755.tar.gz |
Merge 3.5
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/support/script_helper.py | 25 | ||||
-rw-r--r-- | Lib/test/test_imaplib.py | 2 |
2 files changed, 19 insertions, 8 deletions
diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py index 80889b17f3..ca5f9c20dd 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py @@ -70,17 +70,28 @@ def run_python_until_end(*args, **env_vars): elif not env_vars and not env_required: # ignore Python environment variables cmd_line.append('-E') - # Need to preserve the original environment, for in-place testing of - # shared library builds. - env = os.environ.copy() - # set TERM='' unless the TERM environment variable is passed explicitly - # see issues #11390 and #18300 - if 'TERM' not in env_vars: - env['TERM'] = '' + # But a special flag that can be set to override -- in this case, the # caller is responsible to pass the full environment. if env_vars.pop('__cleanenv', None): env = {} + if sys.platform == 'win32': + # Windows requires at least the SYSTEMROOT environment variable to + # start Python. + env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] + + # Other interesting environment variables, not copied currently: + # COMSPEC, HOME, PATH, TEMP, TMPDIR, TMP. + else: + # Need to preserve the original environment, for in-place testing of + # shared library builds. + env = os.environ.copy() + + # set TERM='' unless the TERM environment variable is passed explicitly + # see issues #11390 and #18300 + if 'TERM' not in env_vars: + env['TERM'] = '' + env.update(env_vars) cmd_line.extend(args) proc = subprocess.Popen(cmd_line, stdin=subprocess.PIPE, diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index f451930566..fac6b57081 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -477,7 +477,7 @@ class NewIMAPTests(NewIMAPTestsMixin, unittest.TestCase): @unittest.skipUnless(ssl, "SSL not available") class NewIMAPSSLTests(NewIMAPTestsMixin, unittest.TestCase): - imap_class = imaplib.IMAP4_SSL + imap_class = IMAP4_SSL server_class = SecureTCPServer def test_ssl_raises(self): |