bpo-35661: Fix failing test on buildbot (GH-12297)

This commit is contained in:
Cheryl Sabella 2019-03-12 20:15:47 -04:00 committed by GitHub
parent 26c910c59c
commit 839b925f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -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