summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-03-07 17:51:38 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-03-11 06:38:42 -0500
commitb9f4c86917422de3fe6ecd2976d7213897c93bb2 (patch)
treec8da98046baddd68bcde6a0834f861e071a69a49 /tests/test_process.py
parentaf234f4a2a08dc1616c2270df6349925221c81e8 (diff)
downloadpython-coveragepy-git-b9f4c86917422de3fe6ecd2976d7213897c93bb2.tar.gz
test: reduce use of unittest
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index 548f3dd7..0743e14e 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -1225,8 +1225,8 @@ class PydocTest(CoverageTest):
class FailUnderTest(CoverageTest):
"""Tests of the --fail-under switch."""
- def setUp(self):
- super(FailUnderTest, self).setUp()
+ def setup_test(self):
+ super(FailUnderTest, self).setup_test()
self.make_file("forty_two_plus.py", """\
# I have 42.857% (3/7) coverage!
a = 1
@@ -1448,8 +1448,8 @@ def persistent_remove(path):
class ProcessCoverageMixin(object):
"""Set up a .pth file to coverage-measure all sub-processes."""
- def setUp(self):
- super(ProcessCoverageMixin, self).setUp()
+ def setup_test(self):
+ super(ProcessCoverageMixin, self).setup_test()
# Create the .pth file.
assert PTH_DIR
@@ -1457,17 +1457,16 @@ class ProcessCoverageMixin(object):
pth_path = os.path.join(PTH_DIR, "subcover_{}.pth".format(WORKER))
with open(pth_path, "w") as pth:
pth.write(pth_contents)
- self.pth_path = pth_path
- self.addCleanup(persistent_remove, self.pth_path)
+ self.addCleanup(persistent_remove, pth_path)
@pytest.mark.skipif(env.METACOV, reason="Can't test sub-process pth file during metacoverage")
class ProcessStartupTest(ProcessCoverageMixin, CoverageTest):
"""Test that we can measure coverage in sub-processes."""
- def setUp(self):
- super(ProcessStartupTest, self).setUp()
+ def setup_test(self):
+ super(ProcessStartupTest, self).setup_test()
# Main will run sub.py
self.make_file("main.py", """\