summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2014-02-05 13:54:55 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2014-02-05 13:54:55 (GMT)
commit456ab5d90941962973bed0cf2a3ec0e1c32b046b (patch)
tree6bfe8574d8f59c93d2be7f7ede359b46de291762 /Lib/test/test_venv.py
parent780145daac2c6816627e9493080687b68160b243 (diff)
downloadcpython-456ab5d90941962973bed0cf2a3ec0e1c32b046b.zip
cpython-456ab5d90941962973bed0cf2a3ec0e1c32b046b.tar.gz
cpython-456ab5d90941962973bed0cf2a3ec0e1c32b046b.tar.bz2
Issue #20053: new test to check an assumption
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 6ddbace..58551be 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -288,6 +288,13 @@ class EnsurePipTest(BaseTest):
self.run_with_capture(venv.create, self.env_dir, with_pip=False)
self.assert_pip_not_installed()
+ def test_devnull_exists_and_is_empty(self):
+ # Fix for issue #20053 uses os.devnull to force a config file to
+ # appear empty. Make sure that assumption is valid cross platform.
+ self.assertTrue(os.path.exists, os.devnull)
+ with open(os.devnull, "rb") as f:
+ self.assertEqual(f.read(), b"")
+
# Requesting pip fails without SSL (http://bugs.python.org/issue19744)
@unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE)
def test_with_pip(self):