1. Ned Batchelder
  2. coverage.py

Commits

Ned Batchelder  committed 244005e Merge

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)

  • Participants
  • Parent commits 4e67741, dc2a7b7
  • Branches default

Comments (0)

Files changed (3)

File coverage/files.py

View file
     """
     patterns = patterns or []
     prepped = []
-    for p in patterns or []:
+    for p in patterns:
         if p.startswith("*") or p.startswith("?"):
             prepped.append(p)
         else:

File tests/test_misc.py

View file
 """Tests of miscellaneous stuff."""
+import sys
 
 from coverage.misc import Hasher, file_be_gone
 from coverage import __version__, __url__
         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']

File tests/test_oddball.py

View file
             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