[Python-checkins] cpython: Fix regrtest --coverage on Windows

victor.stinner python-checkins at python.org
Thu Oct 1 00:54:53 CEST 2015


https://hg.python.org/cpython/rev/0f10e0b3e76d
changeset:   98443:0f10e0b3e76d
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Oct 01 00:53:09 2015 +0200
summary:
  Fix regrtest --coverage on Windows

Issue #25260: Fix ``python -m test --coverage`` on Windows. Remove the list of
ignored directories.

files:
  Lib/test/libregrtest/main.py |  5 +----
  Lib/test/test_regrtest.py    |  2 --
  Misc/NEWS                    |  3 +++
  3 files changed, 4 insertions(+), 6 deletions(-)


diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -272,10 +272,7 @@
     def run_tests_sequential(self):
         if self.ns.trace:
             import trace
-            self.tracer = trace.Trace(ignoredirs=[sys.base_prefix,
-                                                  sys.base_exec_prefix,
-                                                  tempfile.gettempdir()],
-                                      trace=False, count=True)
+            self.tracer = trace.Trace(trace=False, count=True)
 
         save_modules = sys.modules.keys()
 
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -605,8 +605,6 @@
                  % (self.TESTNAME_REGEX, len(tests)))
         self.check_line(output, regex)
 
-    @unittest.skipIf(sys.platform == 'win32',
-                     "FIXME: coverage doesn't work on Windows")
     def test_coverage(self):
         # test --coverage
         test = self.create_test()
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -157,6 +157,9 @@
 Tests
 -----
 
+- Issue #25260: Fix ``python -m test --coverage`` on Windows. Remove the
+  list of ignored directories.
+
 - PCbuild\rt.bat now accepts an unlimited number of arguments to pass along
   to regrtest.py.  Previously there was a limit of 9.
 

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


More information about the Python-checkins mailing list