Repository navigation
gh-100690: Prevent prefix "called_" for attributes of safe mock objects #100691
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
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
154012f
Prevent calling assert functions without the prefix "assert_" in safe…
cklein 26dc793
Merge remote-tracking branch 'python/main' into disallow_mock_method_…
cklein 2bd97a1
Added tests to show that names from denylist still can be used with a…
cklein 01946cb
Changed documentation
cklein e9b8f73
Reformatted NEWS
cklein 674f5bc
Merge branch 'main' into disallow_mock_method_prefix
cjw296 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added tests to show that names from denylist still can be used with a…
… spec
- Loading branch information
commit 2bd97a17b535de645c873c0f2553aad91a28767f
There are no files selected for viewing
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
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
4 changes: 2 additions & 2 deletions
4
Misc/NEWS.d/next/Library/2023-01-02-16-59-49.gh-issue-100690.2EgWPS.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| Mock objects which are not unsafe will now raise an AttributeError if an | ||
| attribute with the prefix ``called_`` is accessed, in addition to this already | ||
| happening for the prefixes assert, assret, asert, aseert, assrt. | ||
| attribute that matches the name of an existing assertion is accessed, e.g. ``called_once`` instead of ``assert_called_once``. | ||
| This is in addition to this already happening for accessing attributes with prefixes assert, assret, asert, aseert, and assrt. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.