summaryrefslogtreecommitdiff
path: root/tests/test_filereporter.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-05-04 07:35:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2017-05-04 07:35:24 -0400
commit67f905e4b7002d71d7ab33b87089a876eb4ef66c (patch)
tree44bb3f7b60ca37933e1adc887367c771777cbbb2 /tests/test_filereporter.py
parentb48ec04376ae5c9103bb73e1146473d70c1e5c8e (diff)
downloadpython-coveragepy-git-67f905e4b7002d71d7ab33b87089a876eb4ef66c.tar.gz
Refactor common test infrastructure for fiddling sys.path and finding files
Diffstat (limited to 'tests/test_filereporter.py')
-rw-r--r--tests/test_filereporter.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/test_filereporter.py b/tests/test_filereporter.py
index 59eafa11..91e47762 100644
--- a/tests/test_filereporter.py
+++ b/tests/test_filereporter.py
@@ -4,12 +4,11 @@
"""Tests for FileReporters"""
import os
-import sys
from coverage.plugin import FileReporter
from coverage.python import PythonFileReporter
-from tests.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest, UsingModulesMixin
# pylint: disable=import-error
# Unable to import 'aa' (No module named aa)
@@ -20,17 +19,11 @@ def native(filename):
return filename.replace("/", os.sep)
-class FileReporterTest(CoverageTest):
+class FileReporterTest(UsingModulesMixin, CoverageTest):
"""Tests for FileReporter classes."""
run_in_temp_dir = False
- def setUp(self):
- super(FileReporterTest, self).setUp()
- # Parent class saves and restores sys.path, we can just modify it.
- testmods = self.nice_file(os.path.dirname(__file__), 'modules')
- sys.path.append(testmods)
-
def test_filenames(self):
acu = PythonFileReporter("aa/afile.py")
bcu = PythonFileReporter("aa/bb/bfile.py")