diff options
author | Cheryl Sabella <cheryl.sabella@gmail.com> | 2019-03-13 00:15:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-13 00:15:47 (GMT) |
commit | 839b925f6347222de560cdb767924c502b4039aa (patch) | |
tree | 969ee4665b72fc3e8c03dfc5c5e6fe77f2eba501 /Lib/test/test_venv.py | |
parent | 26c910c59c47bdef4220c34e66c45a625bda5e56 (diff) | |
download | cpython-839b925f6347222de560cdb767924c502b4039aa.zip cpython-839b925f6347222de560cdb767924c502b4039aa.tar.gz cpython-839b925f6347222de560cdb767924c502b4039aa.tar.bz2 |
bpo-35661: Fix failing test on buildbot (GH-12297)
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r-- | Lib/test/test_venv.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index 1ddec72..0b2c7a0 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -110,18 +110,20 @@ class BasicTest(BaseTest): def test_prompt(self): env_name = os.path.split(self.env_dir)[1] + rmtree(self.env_dir) builder = venv.EnvBuilder() + self.run_with_capture(builder.create, self.env_dir) context = builder.ensure_directories(self.env_dir) - self.assertEqual(context.prompt, '(%s) ' % env_name) - builder.create(self.env_dir) data = self.get_text_file_contents('pyvenv.cfg') + self.assertEqual(context.prompt, '(%s) ' % env_name) self.assertNotIn("prompt = ", data) + rmtree(self.env_dir) builder = venv.EnvBuilder(prompt='My prompt') + self.run_with_capture(builder.create, self.env_dir) context = builder.ensure_directories(self.env_dir) - self.assertEqual(context.prompt, '(My prompt) ') - builder.create(self.env_dir) data = self.get_text_file_contents('pyvenv.cfg') + self.assertEqual(context.prompt, '(My prompt) ') self.assertIn("prompt = 'My prompt'\n", data) @skipInVenv |