diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-09 10:55:46 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-09 10:55:46 -0500 |
commit | 29e89f42905d3867932261ccf2b2ac040784b94e (patch) | |
tree | d4128b194594d990ae50c5211908eaa8985b3c37 /tests/test_html.py | |
parent | fcb86086705f885480e89f9b28b0dc6ee58d6657 (diff) | |
download | python-coveragepy-29e89f42905d3867932261ccf2b2ac040784b94e.tar.gz |
Remove (most) tearDown functions in favor of addCleanup
Diffstat (limited to 'tests/test_html.py')
-rw-r--r-- | tests/test_html.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_html.py b/tests/test_html.py index 7af695d..31b4d87 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -63,10 +63,10 @@ class HtmlDeltaTest(HtmlTestHelpers, CoverageTest): # At least one of our tests monkey-patches the version of coverage, # so grab it here to restore it later. self.real_coverage_version = coverage.__version__ + self.addCleanup(self.restore_coverage_version) - def tearDown(self): + def restore_coverage_version(self): coverage.__version__ = self.real_coverage_version - super(HtmlDeltaTest, self).tearDown() def test_html_created(self): # Test basic HTML generation: files should be created. @@ -359,10 +359,10 @@ class HtmlStaticFileTest(CoverageTest): def setUp(self): super(HtmlStaticFileTest, self).setUp() self.original_path = list(coverage.html.STATIC_PATH) + self.addCleanup(self.restore_static_path) - def tearDown(self): + def restore_static_path(self): coverage.html.STATIC_PATH = self.original_path - super(HtmlStaticFileTest, self).tearDown() def test_copying_static_files_from_system(self): # Make a new place for static files. |