Skip to content
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

Provide whitelist parity for MagicMock and Mock #342

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Provide whitelist parity for MagicMock and Mock #342

merged 2 commits into from
Dec 6, 2023

Conversation

maxrake
Copy link
Contributor

@maxrake maxrake commented Dec 6, 2023

Description

There are whitelist entries for the return_value and side_effect
attributes of the unittest.mock.Mock class. This change seeks to
provide parity for the unittest.mock.MagicMock class, which is just a
subclass of Mock but with default implementations of most of the magic
methods.

Standard library reference:
https://docs.python.org/3/library/unittest.mock.html#magic-mock

Checklist:

  • I have updated the documentation in the README.md file or my changes don't require an update.
  • I have added an entry in CHANGELOG.md.
  • I have added or adapted tests to cover my changes.
    • No whitelist tests were found to update
  • I have run tox -e fix-style to format my code and checked the result with tox -e style.

There are whitelist entries for the `return_value` and `side_effect`
attributes of the `unittest.mock.Mock` class. This change seeks to
provide parity for the `unittest.mock.MagicMock` class, which is just a
subclass of `Mock` but with default implementations of most of the magic
methods.

Standard library reference:
https://docs.python.org/3/library/unittest.mock.html#magic-mock
@jendrikseipp jendrikseipp merged commit 3d0ad1a into jendrikseipp:main Dec 6, 2023
15 checks passed
@jendrikseipp
Copy link
Owner

Thanks!

@maxrake maxrake deleted the whitelist_magicmock branch December 6, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants