diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2023-01-22 13:39:19 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2023-01-22 13:39:19 -0500 |
commit | e1ae48eccb45bd439f7f7a696b09f1a7bd565dea (patch) | |
tree | 6089bf47fc814d7459705dfb1fd0384c5d394794 /tests/test_debug.py | |
parent | ff127f8cfb122680c3de289b98f30c36d2eda7fb (diff) | |
download | python-coveragepy-git-e1ae48eccb45bd439f7f7a696b09f1a7bd565dea.tar.gz |
test: more tests of debug output control
Diffstat (limited to 'tests/test_debug.py')
-rw-r--r-- | tests/test_debug.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_debug.py b/tests/test_debug.py index c2d9efe3..60a7b10a 100644 --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -239,22 +239,31 @@ class DebugOutputTest(CoverageTest): def test_stderr_default(self) -> None: self.debug_sys() - assert_good_debug_sys(self.stderr()) + out, err = self.stdouterr() + assert out == "" + assert_good_debug_sys(err) def test_envvar(self) -> None: self.set_environ("COVERAGE_DEBUG_FILE", "debug.out") self.debug_sys() - assert self.stderr() == "" + assert self.stdouterr() == ("", "") with open("debug.out") as f: assert_good_debug_sys(f.read()) def test_config_file(self) -> None: self.make_file(".coveragerc", "[run]\ndebug_file = lotsa_info.txt") self.debug_sys() - assert self.stderr() == "" + assert self.stdouterr() == ("", "") with open("lotsa_info.txt") as f: assert_good_debug_sys(f.read()) + def test_stdout_alias(self) -> None: + self.set_environ("COVERAGE_DEBUG_FILE", "stdout") + self.debug_sys() + out, err = self.stdouterr() + assert err == "" + assert_good_debug_sys(out) + def f_one(*args: Any, **kwargs: Any) -> str: """First of the chain of functions for testing `short_stack`.""" |