diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2023-01-10 13:33:06 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2023-01-10 13:43:49 -0500 |
commit | c9d473b05a1cdcd9d04185ee4fb4b86e1e5f08e3 (patch) | |
tree | 28ff1821f25039d20a2a3e373a0882cc47f30e61 /tests/mixins.py | |
parent | b893cb31f43a9b598990c462cfaa2c8c66779153 (diff) | |
download | python-coveragepy-git-c9d473b05a1cdcd9d04185ee4fb4b86e1e5f08e3.tar.gz |
mypy: install pytest alongside mypy to get its types
Diffstat (limited to 'tests/mixins.py')
-rw-r--r-- | tests/mixins.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/mixins.py b/tests/mixins.py index d207f779..c8f79d67 100644 --- a/tests/mixins.py +++ b/tests/mixins.py @@ -14,7 +14,7 @@ import os import os.path import sys -from typing import Any, Callable, Iterable, Iterator, Optional, Tuple +from typing import Any, Callable, Iterable, Iterator, Optional, Tuple, cast import pytest @@ -138,12 +138,12 @@ class StdStreamCapturingMixin: def stdouterr(self) -> Tuple[str, str]: """Returns (out, err), two strings for stdout and stderr.""" - return self.capsys.readouterr() # type: ignore[no-any-return] + return cast(Tuple[str, str], self.capsys.readouterr()) def stdout(self) -> str: """Returns a string, the captured stdout.""" - return self.capsys.readouterr().out # type: ignore[no-any-return] + return self.capsys.readouterr().out def stderr(self) -> str: """Returns a string, the captured stderr.""" - return self.capsys.readouterr().err # type: ignore[no-any-return] + return self.capsys.readouterr().err |