summaryrefslogtreecommitdiff
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2014-06-03 16:47:51 +0100
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2014-06-03 16:47:51 +0100
commitb9b965f6dd5be211a9ce047ac00070e51bc9b7a8 (patch)
tree1c507386213f24168a078005ca441feea40316d2 /Lib/test/test_venv.py
parent2f78b84c473787664940a97c49f4c64c20a03c48 (diff)
downloadcpython-git-b9b965f6dd5be211a9ce047ac00070e51bc9b7a8.tar.gz
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.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index e13cd8cf98..8dfff519aa 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):
"""