[Python-checkins] cpython: Issue #20053: new test to check an assumption

nick.coghlan python-checkins at python.org
Wed Feb 5 14:55:12 CET 2014


http://hg.python.org/cpython/rev/ddc82c4d1a44
changeset:   88972:ddc82c4d1a44
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Wed Feb 05 23:54:55 2014 +1000
summary:
  Issue #20053: new test to check an assumption

files:
  Lib/test/test_venv.py |  7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -288,6 +288,13 @@
         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):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list