summaryrefslogtreecommitdiff
path: root/test/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-10-27 17:12:16 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-10-27 17:12:16 -0400
commited69ae75ac040c6dbc5921d21f8966c517beb1c0 (patch)
treef1875d6c7d9e863ac55f557dad903247d3f367e4 /test/test_api.py
parent3f19d512f0e72fbc055c488f7344a27267fd0876 (diff)
parentacb2a6f32ca12db086b5f8e0510965d8d563e551 (diff)
downloadpython-coveragepy-git-ed69ae75ac040c6dbc5921d21f8966c517beb1c0.tar.gz
Merged
Diffstat (limited to 'test/test_api.py')
-rw-r--r--test/test_api.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/test_api.py b/test/test_api.py
index 5dc9621d..8f270098 100644
--- a/test/test_api.py
+++ b/test/test_api.py
@@ -342,13 +342,13 @@ class ApiTest(CoverageTest):
cov.report()
-class SourceOmitIncludeTest(CoverageTest):
- """Test using `source`, `omit` and `include` when measuring code."""
+class UsingModulesMixin(object):
+ """A mixin for importing modules from test/modules and test/moremodules."""
run_in_temp_dir = False
def setUp(self):
- super(SourceOmitIncludeTest, self).setUp()
+ super(UsingModulesMixin, self).setUp()
# Parent class saves and restores sys.path, we can just modify it.
self.old_dir = os.getcwd()
os.chdir(self.nice_file(os.path.dirname(__file__), 'modules'))
@@ -357,7 +357,11 @@ class SourceOmitIncludeTest(CoverageTest):
def tearDown(self):
os.chdir(self.old_dir)
- super(SourceOmitIncludeTest, self).tearDown()
+ super(UsingModulesMixin, self).tearDown()
+
+
+class SourceOmitIncludeTest(UsingModulesMixin, CoverageTest):
+ """Test using `source`, `omit` and `include` when measuring code."""
def coverage_usepkgs_summary(self, **kwargs):
"""Run coverage on usepkgs and return the line summary.