diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-17 14:55:14 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-17 14:55:14 -0500 |
commit | e80f5f8fbc370a49040f020f90982ca73767c9fd (patch) | |
tree | 4ea1efaee159146936e35d680952c85c3e6c2cf0 /coverage/codeunit.py | |
parent | a17ce9e93cb61915880a040769e9e40447a6a7d8 (diff) | |
download | python-coveragepy-git-e80f5f8fbc370a49040f020f90982ca73767c9fd.tar.gz |
Use file names with extensions in reports.
--HG--
rename : tests/farm/html/gold_a/a.html => tests/farm/html/gold_a/a_py.html
rename : tests/farm/html/gold_b_branch/b.html => tests/farm/html/gold_b_branch/b_py.html
rename : tests/farm/html/gold_bom/bom.html => tests/farm/html/gold_bom/bom_py.html
rename : tests/farm/html/gold_isolatin1/isolatin1.html => tests/farm/html/gold_isolatin1/isolatin1_py.html
rename : tests/farm/html/gold_omit_1/m1.html => tests/farm/html/gold_omit_1/m1_py.html
rename : tests/farm/html/gold_omit_1/m2.html => tests/farm/html/gold_omit_1/m2_py.html
rename : tests/farm/html/gold_omit_1/m3.html => tests/farm/html/gold_omit_1/m3_py.html
rename : tests/farm/html/gold_omit_1/main.html => tests/farm/html/gold_omit_1/main_py.html
rename : tests/farm/html/gold_omit_2/m2.html => tests/farm/html/gold_omit_2/m2_py.html
rename : tests/farm/html/gold_omit_2/m3.html => tests/farm/html/gold_omit_2/m3_py.html
rename : tests/farm/html/gold_omit_2/main.html => tests/farm/html/gold_omit_2/main_py.html
rename : tests/farm/html/gold_omit_3/m3.html => tests/farm/html/gold_omit_3/m3_py.html
rename : tests/farm/html/gold_omit_3/main.html => tests/farm/html/gold_omit_3/main_py.html
rename : tests/farm/html/gold_omit_4/m1.html => tests/farm/html/gold_omit_4/m1_py.html
rename : tests/farm/html/gold_omit_4/m3.html => tests/farm/html/gold_omit_4/m3_py.html
rename : tests/farm/html/gold_omit_4/main.html => tests/farm/html/gold_omit_4/main_py.html
rename : tests/farm/html/gold_omit_5/m1.html => tests/farm/html/gold_omit_5/m1_py.html
rename : tests/farm/html/gold_omit_5/main.html => tests/farm/html/gold_omit_5/main_py.html
rename : tests/farm/html/gold_other/blah_blah_other.html => tests/farm/html/gold_other/blah_blah_other_py.html
rename : tests/farm/html/gold_other/here.html => tests/farm/html/gold_other/here_py.html
rename : tests/farm/html/gold_partial/partial.html => tests/farm/html/gold_partial/partial_py.html
rename : tests/farm/html/gold_styled/a.html => tests/farm/html/gold_styled/a_py.html
rename : tests/farm/html/gold_unicode/unicode.html => tests/farm/html/gold_unicode/unicode_py.html
Diffstat (limited to 'coverage/codeunit.py')
-rw-r--r-- | coverage/codeunit.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/coverage/codeunit.py b/coverage/codeunit.py index 28155261..e75018d8 100644 --- a/coverage/codeunit.py +++ b/coverage/codeunit.py @@ -28,19 +28,18 @@ class CodeUnit(FileReporter): self.filename = self.file_locator.canonical_filename(f) if hasattr(morf, '__name__'): - n = modname = morf.__name__ + n = morf.__name__ + n = n.replace(".", os.sep) + ".py" self.relative = True else: - n = os.path.splitext(morf)[0] + n = f #os.path.splitext(f)[0] rel = self.file_locator.relative_filename(n) if os.path.isabs(n): self.relative = (rel != n) else: self.relative = True n = rel - modname = None self.name = n - self.modname = modname def _adjust_filename(self, f): # TODO: This shouldn't be in the base class, right? @@ -56,8 +55,5 @@ class CodeUnit(FileReporter): For example, the file a/b/c.py will return 'a_b_c' """ - if self.modname: - return self.modname.replace('.', '_') - else: - root = os.path.splitdrive(self.name)[1] - return root.replace('\\', '_').replace('/', '_').replace('.', '_') + root = os.path.splitdrive(self.name)[1] + return root.replace('\\', '_').replace('/', '_').replace('.', '_') |