diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2014-06-03 15:47:51 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2014-06-03 15:47:51 (GMT) |
commit | b9b965f6dd5be211a9ce047ac00070e51bc9b7a8 (patch) | |
tree | 1c507386213f24168a078005ca441feea40316d2 /Lib/test/test_venv.py | |
parent | 2f78b84c473787664940a97c49f4c64c20a03c48 (diff) | |
download | cpython-b9b965f6dd5be211a9ce047ac00070e51bc9b7a8.zip cpython-b9b965f6dd5be211a9ce047ac00070e51bc9b7a8.tar.gz cpython-b9b965f6dd5be211a9ce047ac00070e51bc9b7a8.tar.bz2 |
Issue #21643: Updated test and fixed logic bug in lib64 symlink creation.
Diffstat (limited to 'Lib/test/test_venv.py')
-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): """ |