Skip to content

Enable aliases in pytest_mock and put on pytest exclude list #4359

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 2 commits into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements-tests-py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ flake8==3.8.3
flake8-bugbear==20.1.4
flake8-pyi==20.5.0
isort[pyproject]==5.1.1
pytype>=2020.07.20
pytype>=2020.07.24
21 changes: 10 additions & 11 deletions third_party/3/pytest_mock/plugin.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ def _get_mock_module(config: _Config) -> _MockModule: ...
class MockFixture:
mock_module: _MockModule
patch: MockFixture._Patcher # google/pytype#611
# The following aliases don't work due to google/pytype#612
Mock: Any # actually unittest.mock.Mock
MagicMock: Any # actually unittest.mock.MagicMock
NonCallableMock: Any # actually unittest.mock.NonCallableMock
PropertyMock: Any # actually unittest.mock.PropertyMock
call: Any # actually unittest.mock.call
ANY: Any # actually unittest.mock.ANY
DEFAULT: Any # actually unittest.mock.DEFAULT
create_autospec: Any # actually unittest.mock.create_autospec
sentinel: Any # actually unittest.mock.sentinel
mock_open: Any # actually unittest.mock.mock_open
Mock = unittest.mock.Mock
MagicMock = unittest.mock.MagicMock
NonCallableMock = unittest.mock.NonCallableMock
PropertyMock = unittest.mock.PropertyMock
call = unittest.mock.call
ANY = unittest.mock.ANY
DEFAULT = unittest.mock.DEFAULT
create_autospec = unittest.mock.create_autospec
sentinel = unittest.mock.sentinel
mock_open = unittest.mock.mock_open
def __init__(self, config: _Config) -> None: ...
def resetall(self) -> None: ...
def stopall(self) -> None: ...
Expand Down