1. Ned Batchelder
  2. coverage.py

Commits

Ned Batchelder  committed 73a0186

Tweaks to Matt's merged pull request.

  • Participants
  • Parent commits 244005e
  • Branches default

Comments (0)

Files changed (4)

File AUTHORS.txt

View file
  • Ignore whitespace
 Guillaume Chazarain
 David Christian
 Marcus Cobden
+Matthew Desmarais
 Danek Duvall
 Ben Finney
 Martin Fuzzey

File coverage/files.py

View file
  • Ignore whitespace
     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:

File tests/test_misc.py

View file
  • Ignore whitespace
 
     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
 

File tests/test_oddball.py

View file
  • Ignore whitespace
             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)