diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-17 07:34:28 -0500 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-17 07:34:28 -0500 |
| commit | b76934606e5b8b87f43c755f8427dbca4ff4b7fa (patch) | |
| tree | 21a5b23a8c2186594a6e7f07c0ddcb21cad34c46 | |
| parent | 0be927f6dc9eeff2f86e6b2e1ab9ae0c05b1e143 (diff) | |
| parent | 0cef5a21d3c3a14ef1e323fe5b9569cacc5e07c7 (diff) | |
| download | python-coveragepy-b76934606e5b8b87f43c755f8427dbca4ff4b7fa.tar.gz | |
Automated merge with ssh://bitbucket.org/ned/coveragepy
| -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 cc0bdde..35bec45 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 115d26c..80495ef 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 cfc5a92..6d1e1fd 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" |
