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

gh-93096: Load doctests in `test_itertools` by donbarbos · Pull Request #131133 · python/cpython · GitHub

/ cpython Public

gh-93096: Load doctests in test_itertools - #131133

Merged
vstinner merged 1 commit into
python:mainfrom
donbarbos:issue-93096-load-doctest
Mar 12, 2025
Merged

gh-93096: Load doctests in test_itertools#131133
vstinner merged 1 commit into
python:mainfrom
donbarbos:issue-93096-load-doctest

Conversation

donbarbos commented Mar 12, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

We have one doctest in Modules/itertoolsmodule.c and none in test_itertolls.py so this is definitely a bug like issue #131069

Copy link
Copy Markdown
Contributor Author

I found tests.addTest(doctest.DocTestSuite patterns in unittests and only these two tests loaded incorrect modules (modules without doctests)
cc @vstinner

vstinner 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

LGTM

Copy link
Copy Markdown
Member

I modified the doctest with the change below, ran make clinic && make, and then ./python -m test test_itertools -v. I confirm that test_itertools catchs the typo (fails).

diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 3e425ee5f92..092316cf255 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -124,7 +124,7 @@ or when the input iterable is exhausted.
     >>> for batch in batched('ABCDEFG', 3):
     ...     print(batch)
     ...
-    ('A', 'B', 'C')
+    ('Aa', 'B', 'C')
     ('D', 'E', 'F')
     ('G',)
 

vstinner merged commit 15a8412 into python:main Mar 12, 2025

Copy link
Copy Markdown

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 12, 2025
(cherry picked from commit 15a8412)

Co-authored-by: donBarbos <donbarbos@proton.me>

bedevere-app Bot commented Mar 12, 2025

Copy link
Copy Markdown

GH-131136 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Mar 12, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 12, 2025
(cherry picked from commit 15a8412)

Co-authored-by: donBarbos <donbarbos@proton.me>

bedevere-app Bot commented Mar 12, 2025

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Mar 12, 2025
vstinner pushed a commit that referenced this pull request Mar 12, 2025
gh-93096: Load doctests in `test_itertools` (GH-131133)
(cherry picked from commit 15a8412)

Co-authored-by: donBarbos <donbarbos@proton.me>
vstinner pushed a commit that referenced this pull request Mar 12, 2025
gh-93096: Load doctests in `test_itertools` (GH-131133)
(cherry picked from commit 15a8412)

Co-authored-by: donBarbos <donbarbos@proton.me>
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