Skip to content

gh-115264: Fix test_functools with -00 mode #115276

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

Merged
merged 2 commits into from
Mar 13, 2024
Merged

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Feb 11, 2024

Now the tests pass with both modes.

@sobolevn sobolevn added tests Tests in the Lib/test dir skip news labels Feb 11, 2024
@sobolevn sobolevn requested a review from rhettinger as a code owner February 11, 2024 07:52
@rhettinger rhettinger removed their request for review February 13, 2024 03:23
@sobolevn sobolevn changed the title gh-115263: Fix test_functools with -00 mode gh-115264: Fix test_functools with -00 mode Mar 7, 2024
@sobolevn sobolevn requested a review from AlexWaygood March 7, 2024 08:24
@sobolevn
Copy link
Member Author

sobolevn commented Mar 7, 2024

Unrelated failure reported: #116455

Comment on lines 3136 to +3140
def test_doc(self):
self.assertEqual(CachedCostItem.cost.__doc__, "The cost of the item.")
self.assertEqual(CachedCostItem.cost.__doc__,
("The cost of the item."
if support.HAVE_DOCSTRINGS
else None))
Copy link
Member

Choose a reason for hiding this comment

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

Or should this whole test just be skipped if we're in -00 mode, maybe?

Copy link
Member Author

@sobolevn sobolevn Mar 7, 2024

Choose a reason for hiding this comment

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

I think that checking that docstring is stripped in -OO is also helpful. So, I prefer to not skip it.

Copy link
Member

Choose a reason for hiding this comment

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

Sure. I don't have a strong opinion either way -- feel free to merge :)

@sobolevn sobolevn merged commit 27df81d into python:main Mar 13, 2024
@sobolevn sobolevn added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Mar 13, 2024
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 13, 2024
(cherry picked from commit 27df81d)

Co-authored-by: Nikita Sobolev <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 13, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Mar 13, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 13, 2024
(cherry picked from commit 27df81d)

Co-authored-by: Nikita Sobolev <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 13, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Mar 13, 2024
sobolevn added a commit that referenced this pull request Mar 13, 2024
…116706)

gh-115264: Fix `test_functools` with `-00` mode (GH-115276)
(cherry picked from commit 27df81d)

Co-authored-by: Nikita Sobolev <[email protected]>
sobolevn added a commit that referenced this pull request Mar 13, 2024
…116707)

gh-115264: Fix `test_functools` with `-00` mode (GH-115276)
(cherry picked from commit 27df81d)

Co-authored-by: Nikita Sobolev <[email protected]>
vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
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