bpo-35661: Store the venv prompt in pyvenv.cfg (GH-11440)

This commit is contained in:
Cheryl Sabella 2019-03-08 17:01:27 -05:00 committed by GitHub
parent 2aab5d310c
commit d5a70c6b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -113,10 +113,16 @@ class BasicTest(BaseTest):
builder = venv.EnvBuilder()
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.assertNotIn("prompt = ", data)
builder = venv.EnvBuilder(prompt='My prompt')
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.assertIn("prompt = 'My prompt'\n", data)
@skipInVenv
def test_prefixes(self):