Skip to content

Commit

Permalink
mypy: Ignore Python 3.13 doctest issuse
Browse files Browse the repository at this point in the history
src/doctest_docutils.py:558: error: Too many values to unpack (2 expected, 6 provided)  [misc]
src/doctest_docutils.py:572: error: Too many values to unpack (2 expected, 6 provided)  [misc]
src/doctest_docutils.py:574: error: Too many values to unpack (2 expected, 6 provided)  [misc]
src/pytest_doctest_docutils.py:269: error: Incompatible return value type (got "TestResults", expected "tuple[int, int]")  [return-value]

- python/typeshed#12625
- doctest.TestResults:
  - typeshed: https://github.com/python/typeshed/blob/089953e/stdlib/doctest.pyi#L47-L55
  - 3.12:
    - https://github.com/python/cpython/blob/3.12/Lib/doctest.py#L108
  - 3.13:
    - https://github.com/python/cpython/blob/3.13/Lib/doctest.py#L111
  • Loading branch information
tony committed Oct 19, 2024
1 parent 36267f7 commit 6c824ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/doctest_docutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def _test() -> int:
options |= doctest.FAIL_FAST
for filename in testfiles:
if filename.endswith((".rst", ".md")) or args.docutils:
failures, _ = testdocutils(
failures, _ = testdocutils( # type: ignore
filename,
module_relative=False,
verbose=verbose,
Expand All @@ -570,9 +570,9 @@ def _test() -> int:
sys.path.insert(0, dirname)
m = __import__(filename[:-3])
del sys.path[0]
failures, _ = doctest.testmod(m, verbose=verbose, optionflags=options)
failures, _ = doctest.testmod(m, verbose=verbose, optionflags=options) # type:ignore
else:
failures, _ = doctest.testfile(
failures, _ = doctest.testfile( # type:ignore
filename,
module_relative=False,
verbose=verbose,
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_doctest_docutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def summarize( # type: ignore
finally:
sys.stdout = old_stdout
out(string_io.getvalue())
return res
return res # type:ignore

def _DocTestRunner__patched_linecache_getlines(
self,
Expand Down

0 comments on commit 6c824ea

Please sign in to comment.