Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doctest for 3.13 #12300

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ dis.disassemble
dis.disco
dis.distb
dis.get_instructions
doctest.TestResults.__doc__
doctest.TestResults.__new__
email.utils.getaddresses
email.utils.parseaddr
filecmp.dircmp.__init__
Expand Down Expand Up @@ -255,6 +253,7 @@ ast.ImportFrom.level # None on the class, but never None on instances
builtins.property.__set_name__ # Doesn't actually exist
collections\.UserList\.index # ignoring pos-or-keyword parameter
dataclasses.KW_ONLY # white lies around defaults
doctest.TestResults.__new__ # NamedTuple with key-word only default
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
enum.auto.value # The stub for enum.auto is nothing like the implementation
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically
Expand Down
6 changes: 6 additions & 0 deletions stdlib/doctest.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import types
import unittest
from _typeshed import ExcInfo
Expand Down Expand Up @@ -42,6 +43,9 @@ __all__ = [
]

class TestResults(NamedTuple):
if sys.version_info >= (3, 13):
def __new__(cls, failed: int, attempted: int, *, skipped: int = 0) -> None: ...
skipped: int
failed: int
attempted: int

Expand Down Expand Up @@ -134,6 +138,8 @@ class DocTestRunner:
original_optionflags: int
tries: int
failures: int
if sys.version_info >= (3, 13):
skips: int
test: DocTest
def __init__(self, checker: OutputChecker | None = None, verbose: bool | None = None, optionflags: int = 0) -> None: ...
def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ...
Expand Down
Loading