summaryrefslogtreecommitdiff
path: root/coverage/codeunit.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-02-21 20:40:39 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-02-21 20:40:39 -0500
commite4a2350b9468c686a353e71440daf61155d72d64 (patch)
treec4d5bd01f53efc2bf0ecb3c57451f9817b8fe330 /coverage/codeunit.py
parenta806df8e0b7802af94995b769095b77621ad5a07 (diff)
downloadpython-coveragepy-git-e4a2350b9468c686a353e71440daf61155d72d64.tar.gz
Get rid of CodeUnit, FileReporter is the new thing.
Diffstat (limited to 'coverage/codeunit.py')
-rw-r--r--coverage/codeunit.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/coverage/codeunit.py b/coverage/codeunit.py
deleted file mode 100644
index ef7e8485..00000000
--- a/coverage/codeunit.py
+++ /dev/null
@@ -1,38 +0,0 @@
-"""Code unit (module) handling for Coverage."""
-
-import os
-
-from coverage.files import FileLocator
-from coverage.plugin import FileReporter
-
-
-class CodeUnit(FileReporter):
- """Code unit: a filename or module.
-
- Instance attributes:
-
- `name` is a human-readable name for this code unit.
- `filename` is the os path from which we can read the source.
-
- """
-
- def __init__(self, morf, file_locator=None):
- self.file_locator = file_locator or FileLocator()
-
- if hasattr(morf, '__file__'):
- filename = morf.__file__
- else:
- filename = morf
- filename = self._adjust_filename(filename)
- self.filename = self.file_locator.canonical_filename(filename)
-
- if hasattr(morf, '__name__'):
- name = morf.__name__
- name = name.replace(".", os.sep) + ".py"
- else:
- name = self.file_locator.relative_filename(filename)
- self.name = name
-
- def _adjust_filename(self, f):
- # TODO: This shouldn't be in the base class, right?
- return f