diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-23 23:10:39 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-08-23 23:10:39 -0400 |
commit | 12860c24734a2d7e05ea6402c7ddcf5bfc470e75 (patch) | |
tree | a6133df98960eb48bb4bf3fd2fff5b431e7caa89 | |
parent | f408a8834b0be15d7ecb11e2f491106da12629a1 (diff) | |
download | python-coveragepy-git-12860c24734a2d7e05ea6402c7ddcf5bfc470e75.tar.gz |
More windows tweaking.
-rw-r--r-- | coverage/files.py | 4 | ||||
-rw-r--r-- | test/test_process.py | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/coverage/files.py b/coverage/files.py index 5ec3d80c..7258acca 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -168,6 +168,10 @@ class PathAliases(object): regex_pat = fnmatch.translate(pattern).replace(r'\Z(', '(') if regex_pat.endswith("$"): regex_pat = regex_pat[:-1] + # We want */a/b.py to match on Windows to, so change slash to match + # either separator. + regex_pat = regex_pat.replace(r"\/", r"[\\/]") + # We want case-insensitive matching, so add that flag. regex = re.compile("(?i)" + regex_pat) # Normalize the result: it must end with a path separator. diff --git a/test/test_process.py b/test/test_process.py index 5b576d1f..33a761c5 100644 --- a/test/test_process.py +++ b/test/test_process.py @@ -173,7 +173,10 @@ class ProcessTest(CoverageTest): # files have been combined together. data = coverage.CoverageData() data.read_file(".coverage") - self.assertEqual(data.summary(fullpath=True), {'src/x.py': 6}) + summary = data.summary(fullpath=True) + self.assertEqual(len(summary), 1) + self.assertEqual(summary.keys()[0], os.path.normpath('src/x.py')) + self.assertEqual(summary.values()[0], 6) def test_missing_source_file(self): # Check what happens if the source is missing when reporting happens. |