diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-05-04 07:35:24 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-05-04 07:35:24 -0400 |
commit | 67f905e4b7002d71d7ab33b87089a876eb4ef66c (patch) | |
tree | 44bb3f7b60ca37933e1adc887367c771777cbbb2 /tests/test_config.py | |
parent | b48ec04376ae5c9103bb73e1146473d70c1e5c8e (diff) | |
download | python-coveragepy-git-67f905e4b7002d71d7ab33b87089a876eb4ef66c.tar.gz |
Refactor common test infrastructure for fiddling sys.path and finding files
Diffstat (limited to 'tests/test_config.py')
-rw-r--r-- | tests/test_config.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 9224046a..9a4e8a5e 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -4,13 +4,10 @@ """Test the config file handling for coverage.py""" -import sys -import os - import coverage from coverage.misc import CoverageException -from tests.coveragetest import CoverageTest +from tests.coveragetest import CoverageTest, UsingModulesMixin class ConfigTest(CoverageTest): @@ -220,15 +217,9 @@ class ConfigTest(CoverageTest): _ = coverage.Coverage() -class ConfigFileTest(CoverageTest): +class ConfigFileTest(UsingModulesMixin, CoverageTest): """Tests of the config file settings in particular.""" - def setUp(self): - super(ConfigFileTest, self).setUp() - # Parent class saves and restores sys.path, we can just modify it. - # Add modules to the path so we can import plugins. - sys.path.append(self.nice_file(os.path.dirname(__file__), 'modules')) - # This sample file tries to use lots of variation of syntax... # The {section} placeholder lets us nest these settings in another file. LOTSA_SETTINGS = """\ |