diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-06-13 21:46:35 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-06-13 21:46:35 -0400 |
commit | cf7fa58279cf644c47864485260a7139d9608b2d (patch) | |
tree | b568ddf59350961a2c4e137a4321ce12093d685e /test/coveragetest.py | |
parent | f198d9d2c0df551ce79d97eb448a62f8bdb0cf26 (diff) | |
download | python-coveragepy-git-cf7fa58279cf644c47864485260a7139d9608b2d.tar.gz |
The 'source' option is a list of directories or packages to limit coverage's attention.
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' |