diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-11-25 20:24:46 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-11-25 22:20:47 -0500 |
commit | 3947e84e79085571c72f9601da86cb3a31c92082 (patch) | |
tree | 27162e4267374f1e6b3699f05b1eed66b3d18fc6 | |
parent | c280e8cafec1e80e841bd9061f3ab1b3f0ade1d1 (diff) | |
download | python-coveragepy-git-3947e84e79085571c72f9601da86cb3a31c92082.tar.gz |
Mark tests that don't need a temp dir
-rw-r--r-- | tests/test_api.py | 14 | ||||
-rw-r--r-- | tests/test_plugins.py | 2 | ||||
-rw-r--r-- | tests/test_summary.py | 2 | ||||
-rw-r--r-- | tests/test_xml.py | 2 |
4 files changed, 15 insertions, 5 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index c5803756..cbb0cf82 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -604,6 +604,8 @@ class ApiTest(CoverageTest): class CurrentInstanceTest(CoverageTest): """Tests of Coverage.current().""" + run_in_temp_dir = False + def assert_current_is_none(self, current): """Assert that a current we expect to be None is correct.""" # During meta-coverage, the None answers will be wrong because the @@ -662,9 +664,11 @@ class NamespaceModuleTest(UsingModulesMixin, CoverageTest): cov.report() -class OmitIncludeTestsMixin(UsingModulesMixin, CoverageTestMethodsMixin): +class IncludeOmitTestsMixin(UsingModulesMixin, CoverageTestMethodsMixin): """Test methods for coverage methods taking include and omit.""" + run_in_temp_dir = False + def filenames_in(self, summary, filenames): """Assert the `filenames` are in the keys of `summary`.""" for filename in filenames.split(): @@ -718,8 +722,8 @@ class OmitIncludeTestsMixin(UsingModulesMixin, CoverageTestMethodsMixin): self.filenames_not_in(result, "p1a p1c p2a p2b") -class SourceOmitIncludeTest(OmitIncludeTestsMixin, CoverageTest): - """Test using `source`, `omit` and `include` when measuring code.""" +class SourceIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest): + """Test using `source`, `include`, and `omit` when measuring code.""" def coverage_usepkgs(self, **kwargs): """Run coverage on usepkgs and return the line summary. @@ -784,7 +788,7 @@ class SourceOmitIncludeTest(OmitIncludeTestsMixin, CoverageTest): self.assertEqual(lines['p1c'], 0) -class ReportIncludeOmitTest(OmitIncludeTestsMixin, CoverageTest): +class ReportIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest): """Tests of the report include/omit functionality.""" def coverage_usepkgs(self, **kwargs): @@ -798,7 +802,7 @@ class ReportIncludeOmitTest(OmitIncludeTestsMixin, CoverageTest): return report.getvalue() -class XmlIncludeOmitTest(OmitIncludeTestsMixin, CoverageTest): +class XmlIncludeOmitTest(IncludeOmitTestsMixin, CoverageTest): """Tests of the XML include/omit functionality. This also takes care of the HTML and annotate include/omit, by virtue diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 87690439..2477f5ce 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -874,6 +874,8 @@ class BadFileTracerTest(FileTracerTest): class ConfigurerPluginTest(CoverageTest): """Test configuring plugins.""" + run_in_temp_dir = False + def test_configurer_plugin(self): cov = coverage.Coverage() cov.set_option("run:plugins", ["tests.plugin_config"]) diff --git a/tests/test_summary.py b/tests/test_summary.py index 01b6f9d0..d7ee28ba 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -768,6 +768,8 @@ class SummaryTest2(UsingModulesMixin, CoverageTest): # needs of their setUp, rather than the product features they are testing. # There's probably a better way to organize these. + run_in_temp_dir = False + def test_empty_files(self): # Shows that empty files like __init__.py are listed as having zero # statements, not one statement. diff --git a/tests/test_xml.py b/tests/test_xml.py index 25c9ee0c..93fee9b7 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -71,6 +71,8 @@ class XmlTestHelpers(CoverageTest): class XmlTestHelpersTest(XmlTestHelpers, CoverageTest): """Tests of methods in XmlTestHelpers.""" + run_in_temp_dir = False + def test_assert_source(self): dom = ElementTree.fromstring("""\ <doc> |