Skip to content

gh-122864: Fix a test_funcattrs.test___builtins__ when executing directly #124845

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 3 commits into from
Oct 2, 2024

Conversation

mbyrnepr2
Copy link
Contributor

gh-122864: Fix a unit test which was failing when the test module was run directly via: python -m test.test_funcattrs.

…le was

run directly via: `python -m test.test_funcattrs`.
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Oct 1, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 1, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@mbyrnepr2 mbyrnepr2 marked this pull request as ready for review October 1, 2024 13:49
@mbyrnepr2 mbyrnepr2 changed the title gh-122864: Fix a unit test which was failing when the test module was gh-122864: Fix a unit test which was failing Oct 1, 2024
@Eclips4 Eclips4 added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Oct 1, 2024
@Eclips4 Eclips4 changed the title gh-122864: Fix a unit test which was failing gh-122864: Fix a test_funcattrs.test___builtins__ when executing directly Oct 1, 2024
Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner
Copy link
Member

vstinner commented Oct 2, 2024

The test works as expected with the fix:

$ ./python -m test.test_funcattrs
..................................
----------------------------------------------------------------------
Ran 34 tests in 0.013s

OK

@Eclips4 Eclips4 merged commit 8fbf10d into python:main Oct 2, 2024
32 checks passed
@miss-islington-app
Copy link

Thanks @mbyrnepr2 for the PR, and @Eclips4 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 Oct 2, 2024
…uting directly (pythonGH-124845)

Previously when executing ``test_functattrs.test___builtins__`` directly, it failed because the fact, that ``__builtins__`` is refers to the built-in module ``builtins`` while it's expects a ``__builtins__.__dict__``. But when this test is being run from another module, then ``__builtins__`` is refers to ``builtins.__dict__``. Now this part of the behaviour is covered.
---------

(cherry picked from commit 8fbf10d)

Co-authored-by: Mark Byrne <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 2, 2024
…uting directly (pythonGH-124845)

Previously when executing ``test_functattrs.test___builtins__`` directly, it failed because the fact, that ``__builtins__`` is refers to the built-in module ``builtins`` while it's expects a ``__builtins__.__dict__``. But when this test is being run from another module, then ``__builtins__`` is refers to ``builtins.__dict__``. Now this part of the behaviour is covered.
---------

(cherry picked from commit 8fbf10d)

Co-authored-by: Mark Byrne <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 2, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 2, 2024
@bedevere-app
Copy link

bedevere-app bot commented Oct 2, 2024

GH-124885 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 Oct 2, 2024
@mbyrnepr2 mbyrnepr2 deleted the issue-122864-fix-unittest branch October 2, 2024 10:25
Eclips4 pushed a commit that referenced this pull request Oct 2, 2024
…cuting directly (GH-124845) (#124885)

gh-122864: Fix a ``test_funcattrs.test___builtins__`` when executing directly (GH-124845)

Previously when executing ``test_functattrs.test___builtins__`` directly, it failed because the fact, that ``__builtins__`` is refers to the built-in module ``builtins`` while it's expects a ``__builtins__.__dict__``. But when this test is being run from another module, then ``__builtins__`` is refers to ``builtins.__dict__``. Now this part of the behaviour is covered.
---------

(cherry picked from commit 8fbf10d)

Co-authored-by: Mark Byrne <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
Yhg1s pushed a commit that referenced this pull request Oct 3, 2024
…cuting directly (GH-124845) (#124884)

gh-122864: Fix a ``test_funcattrs.test___builtins__`` when executing directly (GH-124845)

Previously when executing ``test_functattrs.test___builtins__`` directly, it failed because the fact, that ``__builtins__`` is refers to the built-in module ``builtins`` while it's expects a ``__builtins__.__dict__``. But when this test is being run from another module, then ``__builtins__`` is refers to ``builtins.__dict__``. Now this part of the behaviour is covered.
---------

(cherry picked from commit 8fbf10d)

Co-authored-by: Mark Byrne <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
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.

4 participants