jendrikseipp / vulture

Find dead Python code
MIT License
3.5k stars 152 forks source link

Provide whitelist parity for `MagicMock` and `Mock` #342

Closed maxrake closed 11 months ago

maxrake commented 11 months ago

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:

jendrikseipp commented 11 months ago

Thanks!