-
-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
According to the documentation and code Spy provides extra attributes: https://pytest-mock.readthedocs.io/en/latest/usage.html#spy
pytest-mock/src/pytest_mock/plugin.py
Lines 213 to 218 in 184eb19
| spy_obj = self.patch.object(obj, name, side_effect=wrapped, autospec=autospec) | |
| spy_obj.spy_return = None | |
| spy_obj.spy_return_iter = None | |
| spy_obj.spy_return_list = [] | |
| spy_obj.spy_exception = None | |
| return spy_obj |
But they're not listed in the Spy type.
Spy definition:
pytest-mock/src/pytest_mock/plugin.py
Lines 160 to 162 in 184eb19
| def spy( | |
| self, obj: object, name: str, duplicate_iterators: bool = False | |
| ) -> MockType: |
Spy type definition:
pytest-mock/src/pytest_mock/plugin.py
Lines 29 to 33 in 184eb19
| MockType = Union[ | |
| unittest.mock.MagicMock, | |
| unittest.mock.AsyncMock, | |
| unittest.mock.NonCallableMagicMock, | |
| ] |
This breaks autocomplete 😢
Metadata
Metadata
Assignees
Labels
No labels