Test upgrading an existing environment directory.
(self)
| 419 | self.clear_directory(self.env_dir) |
| 420 | |
| 421 | def test_upgrade(self): |
| 422 | """ |
| 423 | Test upgrading an existing environment directory. |
| 424 | """ |
| 425 | # See Issue #21643: the loop needs to run twice to ensure |
| 426 | # that everything works on the upgrade (the first run just creates |
| 427 | # the venv). |
| 428 | for upgrade in (False, True): |
| 429 | builder = venv.EnvBuilder(upgrade=upgrade) |
| 430 | self.run_with_capture(builder.create, self.env_dir) |
| 431 | self.isdir(self.bindir) |
| 432 | self.isdir(self.include) |
| 433 | self.isdir(*self.lib) |
| 434 | fn = self.get_env_file(self.bindir, self.exe) |
| 435 | if not os.path.exists(fn): |
| 436 | # diagnostics for Windows buildbot failures |
| 437 | bd = self.get_env_file(self.bindir) |
| 438 | print('Contents of %r:' % bd) |
| 439 | print(' %r' % os.listdir(bd)) |
| 440 | self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn) |
| 441 | |
| 442 | def test_isolation(self): |
| 443 | """ |
nothing calls this directly
no test coverage detected