Skip to content

typing.rst contains failing doctests #111681

Closed as not planned
Closed as not planned
@sobolevn

Description

@sobolevn

Bug report

» ./python.exe -m doctest Doc/library/typing.rst
**********************************************************************
File "Doc/library/typing.rst", line 1959, in typing.rst
Failed example:
    get_origin(P.args) is P
Exception raised:
    Traceback (most recent call last):
      File "/Users/sobolev/Desktop/cpython2/Lib/doctest.py", line 1374, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest typing.rst[15]>", line 1, in <module>
        get_origin(P.args) is P
        ^^^^^^^^^^
    NameError: name 'get_origin' is not defined
**********************************************************************
File "Doc/library/typing.rst", line 1961, in typing.rst
Failed example:
    get_origin(P.kwargs) is P
Exception raised:
    Traceback (most recent call last):
      File "/Users/sobolev/Desktop/cpython2/Lib/doctest.py", line 1374, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest typing.rst[16]>", line 1, in <module>
        get_origin(P.kwargs) is P
        ^^^^^^^^^^
    NameError: name 'get_origin' is not defined
**********************************************************************
1 items had failures:
   2 of  47 in typing.rst
***Test Failed*** 2 failures.
                               

My proposal is too:

  1. Fix it
  2. Add a test to test_typing to ensure that doctests pass

Linked PRs

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions