diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2013-04-21 17:17:45 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-04-21 17:17:45 -0400 |
| commit | 9eebc5f21c4d7def572fedc1eea4ec0a1c544b56 (patch) | |
| tree | aa36fafcbbd121da1f49895ae7c2ad70d19f328c | |
| parent | e911a7867e5c5bfac712e56280e61afc166e32c0 (diff) | |
| download | python-coveragepy-9eebc5f21c4d7def572fedc1eea4ec0a1c544b56.tar.gz | |
Tweaks to Matt's merged pull request.
| -rw-r--r-- | AUTHORS.txt | 1 | ||||
| -rw-r--r-- | coverage/files.py | 3 | ||||
| -rw-r--r-- | tests/test_misc.py | 1 | ||||
| -rw-r--r-- | tests/test_oddball.py | 9 |
4 files changed, 7 insertions, 7 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt index 7fb80bd..2202f9c 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -13,6 +13,7 @@ Pablo Carballo Guillaume Chazarain David Christian Marcus Cobden +Matthew Desmarais Danek Duvall Ben Finney Martin Fuzzey diff --git a/coverage/files.py b/coverage/files.py index 5737026..4c55151 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -127,9 +127,8 @@ def prep_patterns(patterns): If `patterns` is None, an empty list is returned. """ - patterns = patterns or [] prepped = [] - for p in patterns: + for p in patterns or []: if p.startswith("*") or p.startswith("?"): prepped.append(p) else: diff --git a/tests/test_misc.py b/tests/test_misc.py index 23bd69f..e7fa436 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -63,6 +63,7 @@ class SetupPyTest(CoverageTest): def test_more_metadata(self): # Let's be sure we pick up our own setup.py + # CoverageTest.tearDown restores the original sys.path. sys.path.insert(0, '') from setup import setup_args diff --git a/tests/test_oddball.py b/tests/test_oddball.py index f136eb4..3352a0c 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -308,11 +308,10 @@ class ExceptionTest(CoverageTest): for f, llist in lines.items(): # 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 + basename = os.path.basename(f) + assert basename.endswith(".py") + if basename[:-3] in callnames: + clean_lines[basename] = llist self.assertEqual(clean_lines, lines_expected) |
