Skip to content

Commit 2b6c946

Browse files
[mypy 1.10.0] Remove 'type: ignore' that became useless
1 parent 4788165 commit 2b6c946

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/_pytest/python_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def __eq__(self, actual) -> bool:
454454
return False
455455

456456
# Return true if the two numbers are within the tolerance.
457-
result: bool = abs(self.expected - actual) <= self.tolerance # type: ignore[arg-type]
457+
result: bool = abs(self.expected - actual) <= self.tolerance
458458
return result
459459

460460
# Ignore type because of https://github.com/python/mypy/issues/4266.

src/_pytest/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def pytest_runtest_call(item: Item) -> None:
167167
del sys.last_value
168168
del sys.last_traceback
169169
if sys.version_info >= (3, 12, 0):
170-
del sys.last_exc # type: ignore[attr-defined]
170+
del sys.last_exc
171171
except AttributeError:
172172
pass
173173
try:
@@ -177,7 +177,7 @@ def pytest_runtest_call(item: Item) -> None:
177177
sys.last_type = type(e)
178178
sys.last_value = e
179179
if sys.version_info >= (3, 12, 0):
180-
sys.last_exc = e # type: ignore[attr-defined]
180+
sys.last_exc = e
181181
assert e.__traceback__ is not None
182182
# Skip *this* frame
183183
sys.last_traceback = e.__traceback__.tb_next

testing/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ def runtest(self):
10321032
assert sys.last_type is IndexError
10331033
assert isinstance(sys.last_value, IndexError)
10341034
if sys.version_info >= (3, 12, 0):
1035-
assert isinstance(sys.last_exc, IndexError) # type: ignore[attr-defined]
1035+
assert isinstance(sys.last_exc, IndexError)
10361036

10371037
assert sys.last_value.args[0] == "TEST"
10381038
assert sys.last_traceback

0 commit comments

Comments
 (0)