Skip to content

Commit cfd06e2

Browse files
authored
Enable aliases in pytest_mock (#4359)
* Require newer pytype
1 parent 2c37551 commit cfd06e2

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

requirements-tests-py3.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ flake8==3.8.3
55
flake8-bugbear==20.1.4
66
flake8-pyi==20.5.0
77
isort[pyproject]==5.1.1
8-
pytype>=2020.07.20
8+
pytype>=2020.07.24

third_party/3/pytest_mock/plugin.pyi

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ def _get_mock_module(config: _Config) -> _MockModule: ...
1414
class MockFixture:
1515
mock_module: _MockModule
1616
patch: MockFixture._Patcher # google/pytype#611
17-
# The following aliases don't work due to google/pytype#612
18-
Mock: Any # actually unittest.mock.Mock
19-
MagicMock: Any # actually unittest.mock.MagicMock
20-
NonCallableMock: Any # actually unittest.mock.NonCallableMock
21-
PropertyMock: Any # actually unittest.mock.PropertyMock
22-
call: Any # actually unittest.mock.call
23-
ANY: Any # actually unittest.mock.ANY
24-
DEFAULT: Any # actually unittest.mock.DEFAULT
25-
create_autospec: Any # actually unittest.mock.create_autospec
26-
sentinel: Any # actually unittest.mock.sentinel
27-
mock_open: Any # actually unittest.mock.mock_open
17+
Mock = unittest.mock.Mock
18+
MagicMock = unittest.mock.MagicMock
19+
NonCallableMock = unittest.mock.NonCallableMock
20+
PropertyMock = unittest.mock.PropertyMock
21+
call = unittest.mock.call
22+
ANY = unittest.mock.ANY
23+
DEFAULT = unittest.mock.DEFAULT
24+
create_autospec = unittest.mock.create_autospec
25+
sentinel = unittest.mock.sentinel
26+
mock_open = unittest.mock.mock_open
2827
def __init__(self, config: _Config) -> None: ...
2928
def resetall(self) -> None: ...
3029
def stopall(self) -> None: ...

0 commit comments

Comments
 (0)