Skip to content

Commit 9be4d8b

Browse files
committed
Fix mypy errors
1 parent 35ca665 commit 9be4d8b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/xdoctest/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def _label_docsrc_lines(self, string: str) -> list[tuple[str, str]]:
722722
"""
723723

724724
# parse and differentiate between doctest source and want statements.
725-
labeled_lines = []
725+
labeled_lines: list[tuple[str, str]] = []
726726
state_indent = 0
727727

728728
# line states
@@ -837,8 +837,8 @@ def _label_docsrc_lines(self, string: str) -> list[tuple[str, str]]:
837837
print('line = {!r}'.format(line))
838838
print('Failed to label source lines')
839839
print('Labeled lines so far: <[[[[[[[[[[')
840-
for line in labeled_lines:
841-
print(line)
840+
for _line in labeled_lines:
841+
print(_line)
842842
print(']]]]]]]]]]>')
843843
print('</LABEL FAIL>')
844844
raise

src/xdoctest/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,17 +450,17 @@ def func():
450450
xdoctest_item.funcargs = {}
451451
fm = xdoctest_item.session._fixturemanager
452452
xdoctest_item._fixtureinfo = fm.getfixtureinfo(
453-
node=xdoctest_item, func=func, cls=None, funcargs=False # type: ignore[attr-defined]
453+
node=xdoctest_item, func=func, cls=None, funcargs=False # type: ignore[attr-defined, call-arg]
454454
)
455455
# Note: FixtureRequest may change in the future, we are using
456456
# private functionality. Hopefully it wont break, but we should
457457
# check to see if there is a better way to do this
458458
# https://github.com/pytest-dev/pytest/discussions/8512#discussioncomment-563347
459459
if _PYTEST_IS_GE_620:
460460
# The "_ispytest" arg was added in 3.6.1
461-
fixture_request = fixtures.FixtureRequest(xdoctest_item, _ispytest=True) # type: ignore[abstract, call-arg]
461+
fixture_request = fixtures.FixtureRequest(xdoctest_item, _ispytest=True) # type: ignore[abstract, call-arg, arg-type]
462462
else:
463-
fixture_request = fixtures.FixtureRequest(xdoctest_item) # type: ignore[abstract, call-arg]
463+
fixture_request = fixtures.FixtureRequest(xdoctest_item) # type: ignore[abstract, call-arg, arg-type]
464464
fixture_request._fillfixtures() # type: ignore[attr-defined]
465465
return fixture_request
466466

0 commit comments

Comments
 (0)