FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-112155: Run `typing.py` doctests during tests by sobolevn · Pull Request #112156 · python/cpython · GitHub

Repository navigation

gh-112155: Run typing.py doctests during tests - #112156

Merged
AlexWaygood merged 4 commits into
python:mainfrom
sobolevn:issue-112155
Nov 16, 2023
Merged

AlexWaygood merged 4 commits into
python:mainfrom
sobolevn:issue-112155

Conversation

sobolevn commented Nov 16, 2023 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

After this change we can detect some hypothetical problems with doctests in typing.py.
After my change to some incorrect value doctest fails:

» ./python.exe -m test test_typing   
Using random seed: 3171999375
0:00:00 load avg: 1.44 Run 1 test sequentially
0:00:00 load avg: 1.44 [1/1] test_typing
test test_typing failed -- Traceback (most recent call last):
  File "/Users/sobolev/Desktop/cpython2/Lib/doctest.py", line 2267, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for typing.get_protocol_members
  File "/Users/sobolev/Desktop/cpython2/Lib/typing.py", line 3398, in get_protocol_members

----------------------------------------------------------------------
File "/Users/sobolev/Desktop/cpython2/Lib/typing.py", line 3407, in typing.get_protocol_members
Failed example:
    get_protocol_members(P)
Expected:
    frozenset({'a', 'b', 'c'})
Got:
    frozenset({'a', 'b'})


test_typing failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test_typing

Total duration: 253 ms
Total tests: run=601 failures=1 skipped=1
Total test files: run=1/1 failed=1
Result: FAILURE

AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice, thanks!

Comment thread Lib/test/test_typing.py Outdated
AlexWaygood enabled auto-merge (squash) November 16, 2023 15:25
AlexWaygood self-assigned this Nov 16, 2023
AlexWaygood merged commit 7680da4 into python:main Nov 16, 2023

Copy link
Copy Markdown

Thanks @sobolevn for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

Copy link
Copy Markdown

Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7680da458398c5a08b9c32785b1eeb7b7c0887e4 3.12

Copy link
Copy Markdown

Sorry, @sobolevn and @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7680da458398c5a08b9c32785b1eeb7b7c0887e4 3.11

Copy link
Copy Markdown
Member Author

Will do manual backports later

Copy link
Copy Markdown
Member

Will do manual backports later

I just realised that there are no doctests in Lib/typing.py on the 3.12 or 3.11 branches, so there's no need :)

I'll just remove the "needs backport" labels.

AlexWaygood removed needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Nov 16, 2023

Copy link
Copy Markdown
Member

I just realised that there are no doctests in Lib/typing.py on the 3.12 or 3.11 branches, so there's no need :)

We now do, of course, following the changes made for #112194, so if you're still up for backporting this to 3.12 and 3.11, that would be great :-)

Copy link
Copy Markdown
Member Author

Sure!

sobolevn added a commit to sobolevn/cpython that referenced this pull request Nov 18, 2023

bedevere-app Bot commented Nov 18, 2023

Copy link
Copy Markdown

GH-112230 is a backport of this pull request to the 3.12 branch.

sobolevn added a commit to sobolevn/cpython that referenced this pull request Nov 18, 2023

bedevere-app Bot commented Nov 18, 2023

Copy link
Copy Markdown

GH-112231 is a backport of this pull request to the 3.11 branch.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL