diff options
-rw-r--r-- | CHANGES.txt | 6 | ||||
-rw-r--r-- | coverage/control.py | 4 | ||||
-rw-r--r-- | test/test_process.py | 2 |
3 files changed, 11 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index cc0bdde3..35bec455 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,12 @@ Version 3.6b2 - ``debug sys`` now shows the configuration file path that was read. +- If an oddly-behaved package claims that code came from an empty-string + filename, coverage.py no longer associates it with the directory name, + fixing `issue 221`_. + +.. _issue 221: https://bitbucket.org/ned/coveragepy/issue/221/coveragepy-incompatible-with-pyratemp + .. _issue 80: https://bitbucket.org/ned/coveragepy/issue/80/is-there-a-duck-typing-way-to-know-we-cant diff --git a/coverage/control.py b/coverage/control.py index 115d26c3..80495ef4 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -209,6 +209,10 @@ class coverage(object): should not. """ + if not filename: + # Empty string is pretty useless + return False + if filename.startswith('<'): # Lots of non-file execution is represented with artificial # filenames like "<string>", "<doctest readme.txt[0]>", or diff --git a/test/test_process.py b/test/test_process.py index cfc5a926..6d1e1fd0 100644 --- a/test/test_process.py +++ b/test/test_process.py @@ -483,7 +483,7 @@ class ProcessStartupTest(CoverageTest): # Clean up the .pth file we made. os.remove(self.pth_path) - def test_subprocess_with_pth_files(self): + def test_subprocess_with_pth_files(self): # pragma: not covered if os.environ.get('COVERAGE_COVERAGE', ''): raise SkipTest( "Can't test subprocess pth file suppport during metacoverage" |