From 2b6c946a2bdcf4bb6bf9b04fadf8e24160aa631f Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 30 Apr 2024 18:11:06 +0200 Subject: [PATCH] [mypy 1.10.0] Remove 'type: ignore' that became useless --- src/_pytest/python_api.py | 2 +- src/_pytest/runner.py | 4 ++-- testing/test_runner.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 7d89fdd809e..9b17e5cb786 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -454,7 +454,7 @@ def __eq__(self, actual) -> bool: return False # Return true if the two numbers are within the tolerance. - result: bool = abs(self.expected - actual) <= self.tolerance # type: ignore[arg-type] + result: bool = abs(self.expected - actual) <= self.tolerance return result # Ignore type because of https://github.com/python/mypy/issues/4266. diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index eb444f2e322..5b7cd3e1dad 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -167,7 +167,7 @@ def pytest_runtest_call(item: Item) -> None: del sys.last_value del sys.last_traceback if sys.version_info >= (3, 12, 0): - del sys.last_exc # type: ignore[attr-defined] + del sys.last_exc except AttributeError: pass try: @@ -177,7 +177,7 @@ def pytest_runtest_call(item: Item) -> None: sys.last_type = type(e) sys.last_value = e if sys.version_info >= (3, 12, 0): - sys.last_exc = e # type: ignore[attr-defined] + sys.last_exc = e assert e.__traceback__ is not None # Skip *this* frame sys.last_traceback = e.__traceback__.tb_next diff --git a/testing/test_runner.py b/testing/test_runner.py index ecb98f2ffc2..6bd4a045db6 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -1032,7 +1032,7 @@ def runtest(self): assert sys.last_type is IndexError assert isinstance(sys.last_value, IndexError) if sys.version_info >= (3, 12, 0): - assert isinstance(sys.last_exc, IndexError) # type: ignore[attr-defined] + assert isinstance(sys.last_exc, IndexError) assert sys.last_value.args[0] == "TEST" assert sys.last_traceback