Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-130428: Add tests for delattr suggestions#130455

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Pranjal095 wants to merge4 commits intopython:main
base:main
Choose a base branch
Loading
fromPranjal095:delattr-suggestion-tests

Conversation

Pranjal095
Copy link

@Pranjal095Pranjal095 commentedFeb 22, 2025
edited by picnixz
Loading

Depends on#130427.

With reference to the enhancement proposed inissue #130425, tests have been added to ensure proper functionality of delattr suggestions. To maintain consistency and readability of the code, they mirror the tests for getattr suggestions existing in the modified file (Lib/test/test_traceback.py).

@ghost
Copy link

ghost commentedFeb 22, 2025
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

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

actual = self.get_suggestion(lambda: delattr(obj, 'somethingverywrong'))
self.assertNotIn("blech", actual)

def test_delattr_error_bad_suggestions_do_not_trigger_for_small_names(self):
Copy link
Member

Choose a reason for hiding this comment

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

This test is the same as forgetattr, can't it be refactored so that we use the same fixtures but with different calls toself.get_suggestion?

Copy link
Author

Choose a reason for hiding this comment

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

I was actually thinking of doing that, but decided to go with duplication for better readability.
On reconsideration with your review, I believe it is redundant and should be refactored. Will update the PR accordingly.

@tomasr8
Copy link
Member

@Pranjal095 Some of the tests you added are failing, could you fix them please?

@Pranjal095
Copy link
Author

@tomasr8 The reason for the proposed tests failing is that the pull request implementing name suggestions for delattr is yet to be merged into the main branch. Pull request linkedhere.
Locally, I ran the tests with the pull request changes and they all passed.

tomasr8 reacted with thumbs up emoji

@picnixz
Copy link
Member

Let's put it as a draft until#130427 is merged then.

tomasr8 and Pranjal095 reacted with thumbs up emoji

@picnixzpicnixz marked this pull request as draftFebruary 23, 2025 12:44
@encukou
Copy link
Member

Usually we'd merge a new feature together with its tests. Could you combine the PRs into one?

Pranjal095 added a commit to Pranjal095/cpython that referenced this pull requestMar 3, 2025
…gestions-combinedThis merges the delattr suggestion feature implementation by@sobolevn from PRpython#130427 with added tests from PRpython#130455.
@Pranjal095
Copy link
Author

I've made a new PR combining the commits from both corresponding forks. Kindly let me know if there are any further modifications to be made.

@python-cla-bot
Copy link

python-cla-botbot commentedApr 18, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz left review comments

Assignees
No one assigned
Labels
skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@Pranjal095@tomasr8@picnixz@encukou

[8]ページ先頭

©2009-2025 Movatter.jp