diff options
Diffstat (limited to 'test/coveragetest.py')
-rw-r--r-- | test/coveragetest.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py index 9b85b034..f09afc1f 100644 --- a/test/coveragetest.py +++ b/test/coveragetest.py @@ -121,12 +121,14 @@ class CoverageTest(TestCase): """Return the data written to stderr during the test.""" return self.captured_stderr.getvalue() - def make_file(self, filename, text): + def make_file(self, filename, text=""): """Create a temp file. `filename` is the path to the file, including directories if desired, and `text` is the content. + Returns the path to the file. + """ # Tests that call `make_file` should be run in a temp environment. assert self.run_in_temp_dir @@ -142,6 +144,8 @@ class CoverageTest(TestCase): f.write(text) f.close() + return filename + def import_module(self, modname): """Import the module named modname, and return the module object.""" modfile = modname + '.py' |