diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2014-06-03 15:48:39 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2014-06-03 15:48:39 (GMT) |
commit | 4e9ae159671bbe9d1aaa49613e1689e7f69d56c3 (patch) | |
tree | 72d07264f107b5e5663fb9475d0495ae42217bbe /Lib/test | |
parent | b369f5875c78bf6252b94862eb93bdb2f71c77c0 (diff) | |
parent | b9b965f6dd5be211a9ce047ac00070e51bc9b7a8 (diff) | |
download | cpython-4e9ae159671bbe9d1aaa49613e1689e7f69d56c3.zip cpython-4e9ae159671bbe9d1aaa49613e1689e7f69d56c3.tar.gz cpython-4e9ae159671bbe9d1aaa49613e1689e7f69d56c3.tar.bz2 |
Closes #21643: Merged fix from 3.4.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_venv.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index e13cd8c..8dfff51 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -203,17 +203,22 @@ class BasicTest(BaseTest): """ Test upgrading an existing environment directory. """ - builder = venv.EnvBuilder(upgrade=True) - self.run_with_capture(builder.create, self.env_dir) - self.isdir(self.bindir) - self.isdir(self.include) - self.isdir(*self.lib) - fn = self.get_env_file(self.bindir, self.exe) - if not os.path.exists(fn): # diagnostics for Windows buildbot failures - bd = self.get_env_file(self.bindir) - print('Contents of %r:' % bd) - print(' %r' % os.listdir(bd)) - self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn) + # See Issue #21643: the loop needs to run twice to ensure + # that everything works on the upgrade (the first run just creates + # the venv). + for upgrade in (False, True): + builder = venv.EnvBuilder(upgrade=upgrade) + self.run_with_capture(builder.create, self.env_dir) + self.isdir(self.bindir) + self.isdir(self.include) + self.isdir(*self.lib) + fn = self.get_env_file(self.bindir, self.exe) + if not os.path.exists(fn): + # diagnostics for Windows buildbot failures + bd = self.get_env_file(self.bindir) + print('Contents of %r:' % bd) + print(' %r' % os.listdir(bd)) + self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn) def test_isolation(self): """ |