Fix mypy errors

This commit is contained in:
Bruno Oliveira 2022-03-16 13:05:23 -03:00
parent 85f1a2875b
commit 1a425a51f4
3 changed files with 6 additions and 4 deletions

View File

@ -309,7 +309,9 @@ def _prepareconfig(
elif isinstance(args, os.PathLike):
args = [os.fspath(args)]
elif not isinstance(args, list):
msg = "`args` parameter expected to be a list of strings, got: {!r} (type: {})"
msg = ( # type:ignore[unreachable]
"`args` parameter expected to be a list of strings, got: {!r} (type: {})"
)
raise TypeError(msg.format(args, type(args)))
config = get_config(args, plugins)

View File

@ -397,7 +397,7 @@ if TYPE_CHECKING:
from _pytest.scope import _ScopeName
class _SkipMarkDecorator(MarkDecorator):
@overload # type: ignore[override,misc]
@overload # type: ignore[override,misc,no-overload-impl]
def __call__(self, arg: Markable) -> Markable:
...
@ -415,7 +415,7 @@ if TYPE_CHECKING:
...
class _XfailMarkDecorator(MarkDecorator):
@overload # type: ignore[override,misc]
@overload # type: ignore[override,misc,no-overload-impl]
def __call__(self, arg: Markable) -> Markable:
...

View File

@ -1059,7 +1059,7 @@ class TestAssertionRewriteHookDetails:
e = OSError()
e.errno = 10
raise e
yield
yield # type:ignore[unreachable]
monkeypatch.setattr(
_pytest.assertion.rewrite, "atomic_write", atomic_write_failed