summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2013-04-21 17:04:10 -0400
committerNed Batchelder <nedbat@gmail.com>2013-04-21 17:04:10 -0400
commita206d43e09b841e240c8fc547b22f613dc5eabcd (patch)
tree10cb72dbbacb00da728a202f52c579f3e1fd7716
parent70f663dc0ae6f8e663c0e048796f837cf0ef2983 (diff)
parent82c4c9f038bce0635ee565f80953c9fa9ff61dfe (diff)
downloadpython-coveragepy-git-a206d43e09b841e240c8fc547b22f613dc5eabcd.tar.gz
Merged in desmaj/coverage.py (pull request #17)
Removed redundant code; Changed a setup.py test to ensure that the proper setup.py is imported; Changed the 'oddball' tests to use a filename whitelist instead of a blacklist (so that tests run better under instrumental)
-rw-r--r--coverage/files.py2
-rw-r--r--tests/test_misc.py3
-rw-r--r--tests/test_oddball.py5
3 files changed, 8 insertions, 2 deletions
diff --git a/coverage/files.py b/coverage/files.py
index 3a3a7732..5737026e 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -129,7 +129,7 @@ def prep_patterns(patterns):
"""
patterns = patterns or []
prepped = []
- for p in patterns or []:
+ for p in patterns:
if p.startswith("*") or p.startswith("?"):
prepped.append(p)
else:
diff --git a/tests/test_misc.py b/tests/test_misc.py
index ef4a8774..23bd69fd 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -1,4 +1,5 @@
"""Tests of miscellaneous stuff."""
+import sys
from coverage.misc import Hasher, file_be_gone
from coverage import __version__, __url__
@@ -61,6 +62,8 @@ class SetupPyTest(CoverageTest):
self.assertIn("Ned Batchelder", out[3])
def test_more_metadata(self):
+ # Let's be sure we pick up our own setup.py
+ sys.path.insert(0, '')
from setup import setup_args
classifiers = setup_args['classifiers']
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index 60fab48f..f136eb49 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -306,7 +306,10 @@ class ExceptionTest(CoverageTest):
lines = cov.data.line_data()
clean_lines = {}
for f, llist in lines.items():
- if f == __file__:
+ # f is a path to a python module, so we drop the '.py' to get
+ # a callname
+ callname = os.path.basename(f)[:-3]
+ if callname not in callnames:
# ignore this file.
continue
clean_lines[os.path.basename(f)] = llist