From 57132e79988248b7a28b274a2b63ce4afd3fdc3a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 21 Jun 2010 08:00:48 -0400 Subject: Give this helper function a better name, it's confused me too many times. --- test/coveragetest.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'test/coveragetest.py') 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() -- cgit v1.2.1