diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-06-21 08:00:48 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-06-21 08:00:48 -0400 |
commit | 57132e79988248b7a28b274a2b63ce4afd3fdc3a (patch) | |
tree | 24dd90f9705690febd97e7776fc6bea1ee946bc2 /test/coveragetest.py | |
parent | 9f323147ddf875ce158bd3f1792b69c4004b7caa (diff) | |
download | python-coveragepy-git-57132e79988248b7a28b274a2b63ce4afd3fdc3a.tar.gz |
Give this helper function a better name, it's confused me too many times.
Diffstat (limited to 'test/coveragetest.py')
-rw-r--r-- | test/coveragetest.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py index f09afc1f..4dd87559 100644 --- a/test/coveragetest.py +++ b/test/coveragetest.py @@ -146,8 +146,13 @@ class CoverageTest(TestCase): return filename - def import_module(self, modname): - """Import the module named modname, and return the module object.""" + def import_local_file(self, modname): + """Import a local file as a module. + + Opens a file in the current directory named `modname`.py, imports it + as `modname`, and returns the module object. + + """ modfile = modname + '.py' f = open(modfile, 'r') @@ -255,7 +260,7 @@ class CoverageTest(TestCase): try: # pragma: recursive coverage # Import the python file, executing it. - mod = self.import_module(modname) + mod = self.import_local_file(modname) finally: # pragma: recursive coverage # Stop Coverage. cov.stop() |