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

gh-103272: add regression test for getattr that raises by sunmy2019 · Pull Request #103336 · python/cpython · GitHub

/ cpython Public

gh-103272: add regression test for getattr that raises - #103336

Merged
hauntsaninja merged 6 commits into
python:mainfrom
sunmy2019:test-case-for-gh-103272
Apr 7, 2023
Merged

gh-103272: add regression test for getattr that raises#103336
hauntsaninja merged 6 commits into
python:mainfrom
sunmy2019:test-case-for-gh-103272

Conversation

Copy link
Copy Markdown
Member

Add test case taken from gh-103272 for #103332.

bedevere-bot added the tests Tests in the Lib/test dir label Apr 7, 2023

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

hauntsaninja left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

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

Awesome work, thanks for narrowing this down!

I think we can make the test case slightly simpler to make it clearer what's getting tested:

class A:
    def __getattr__(self, name):
        raise ValueError
    @property
    def foo(self):
        return self.__getattr__("asdf")

A().foo

And maybe rename the test to test_getattr_raises or something

hauntsaninja changed the title add test case for gh-103272 gh-103272: add regression test Apr 7, 2023
hauntsaninja changed the title gh-103272: add regression test gh-103272: add regression test for getattr that raises Apr 7, 2023

sobolevn commented Apr 7, 2023

Copy link
Copy Markdown
Member

I've got the revert merged, now this test must pass :)

sobolevn 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

Thank you!

Comment thread Lib/test/test_descr.py Outdated
Comment thread Lib/test/test_descr.py Outdated

sobolevn 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

Congrats on your first CPython PR 🎉

hauntsaninja left a comment

Copy link
Copy Markdown
Contributor

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

Thanks again, this is great!

hauntsaninja added the needs backport to 3.11 only security fixes label Apr 7, 2023
hauntsaninja merged commit 5d7d86f into python:main Apr 7, 2023

Copy link
Copy Markdown
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 7, 2023
…ythonGH-103336)

(cherry picked from commit 5d7d86f)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>

Copy link
Copy Markdown

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

bedevere-bot removed the needs backport to 3.11 only security fixes label Apr 7, 2023
miss-islington added a commit that referenced this pull request Apr 7, 2023
(cherry picked from commit 5d7d86f)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
sunmy2019 deleted the test-case-for-gh-103272 branch May 10, 2023 14:01
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.

6 participants


Back | FazBrowse Home | New Git URL