summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-02-02 09:12:47 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-02-02 09:12:47 -0500
commit80c021d9174e7ae3e5183f1902903fb90a891246 (patch)
treea0edae6ca0996217b9f0fa3213f824eab8b1cbe1 /tests/test_api.py
parent9012623110f49635fff61d19a4f5bb779de91b99 (diff)
downloadpython-coveragepy-git-80c021d9174e7ae3e5183f1902903fb90a891246.tar.gz
refactor: remove reliance on unittest_mixins.StdStreamCapturingMixin
This is another step toward removing unittest.TestCase as a base class.
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 6c322795..ea625ff1 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -520,10 +520,8 @@ class ApiTest(CoverageTest):
self.start_import_stop(cov, "hello")
cov.get_data()
- out = self.stdout()
+ out, err = self.stdouterr()
assert "Hello\n" in out
-
- err = self.stderr()
assert textwrap.dedent("""\
Coverage.py warning: Module sys has no Python source. (module-not-python)
Coverage.py warning: Module xyzzy was never imported. (module-not-imported)
@@ -544,10 +542,8 @@ class ApiTest(CoverageTest):
self.start_import_stop(cov, "hello")
cov.get_data()
- out = self.stdout()
+ out, err = self.stdouterr()
assert "Hello\n" in out
-
- err = self.stderr()
assert "Coverage.py warning: Module sys has no Python source. (module-not-python)" in err
assert "module-not-imported" not in err
assert "no-data-collected" not in err