diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2023-04-30 07:36:15 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2023-04-30 07:36:15 -0400 |
commit | dc36a46778f5e37a4855bc9d202b397ba63f99a7 (patch) | |
tree | 8c19443cbce1a97ff164a99fcf73e1db0ce8680a /tests | |
parent | e312adf6975e2e863109d69b87528286f8f2b763 (diff) | |
download | python-coveragepy-git-dc36a46778f5e37a4855bc9d202b397ba63f99a7.tar.gz |
test: slim down the fake stdout test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_misc.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py index d489f171..4b83f8ae 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -6,7 +6,6 @@ from __future__ import annotations import sys -from typing import Any from unittest import mock import pytest @@ -170,15 +169,6 @@ def test_stdout_link_not_tty() -> None: def test_stdout_link_with_fake_stdout() -> None: # If stdout is another object, we should still be ok. - class FakeStdout: - """New stdout, has .write(), but not .isatty().""" - def __init__(self, f: Any) -> None: - self.f = f - - def write(self, data: str) -> Any: - """Write through to the underlying file.""" - return self.f.write(data) - - with mock.patch.object(sys, "stdout", FakeStdout(sys.stdout)): + with mock.patch.object(sys, "stdout", object()): link = stdout_link("some text", "some url") assert link == "some text" |