Skip to content

Commit 3d0ad1a

Browse files
authored
Provide whitelist parity for MagicMock and Mock (#342)
* Provide whitelist parity for `MagicMock` and `Mock` 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
1 parent f13cc87 commit 3d0ad1a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# next (unreleased)
2-
* Bump flake8, flake8-comprehensions and flake8-bugbear. (Sebastian Csar,
3-
#341).
2+
* Bump flake8, flake8-comprehensions and flake8-bugbear (Sebastian Csar, #341).
43
* Switch to tomllib/tomli to support heterogeneous arrays (Sebastian Csar, #340).
4+
* Provide whitelist parity for `MagicMock` and `Mock` (maxrake).
55

66
# 2.10 (2023-10-06)
77

vulture/whitelists/unittest_whitelist.py

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414

1515
mock.Mock.return_value
1616
mock.Mock.side_effect
17+
18+
mock.MagicMock.return_value
19+
mock.MagicMock.side_effect

0 commit comments

Comments
 (0)