summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/mixins.py8
-rw-r--r--tests/test_oddball.py1
-rw-r--r--tests/test_venv.py2
3 files changed, 6 insertions, 5 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
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index a44beae4..23e3ce9d 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -209,6 +209,7 @@ class MemoryFumblingTest(CoverageTest):
pytest.skip("This is too expensive for now (30s)")
# Start and stop coverage thousands of times to flush out bad
# reference counting, maybe.
+ _ = "this is just here to put a type comment on" # type: ignore[unreachable]
self.make_file("the_code.py", """\
import random
def f():
diff --git a/tests/test_venv.py b/tests/test_venv.py
index eb4ed5c0..de7ebbe1 100644
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -48,7 +48,7 @@ def venv_world_fixture(tmp_path_factory: pytest.TempPathFactory) -> Path:
Returns the directory containing the "venv" virtualenv.
"""
- venv_world = cast(Path, tmp_path_factory.mktemp("venv_world"))
+ venv_world = tmp_path_factory.mktemp("venv_world")
with change_dir(venv_world):
# Create a virtualenv.
run_command("python -m venv venv")