-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
plugin: monkeypatchrelated to the monkeypatch builtin pluginrelated to the monkeypatch builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
Hi,
I've got this test
import functools
from unittest.mock import Mock
def test_partial(monkeypatch):
monkeypatch.setattr(functools, "partial", Mock())
assert functools.partial.call_count == 1Running pytest on a clean environment produces:
INTERNALERROR> if isinstance(obj, functools.partial):
INTERNALERROR> TypeError: isinstance() arg 2 must be a type or tuple of types
I'm not sure if this kind of patching is supported.
Note that the error only happens if the assert causes the test to fail, otherwise everything works.
I'm using version 3.4.2
pip list:
attrs (17.4.0)
pip (9.0.1)
pkg-resources (0.0.0)
pluggy (0.6.0)
py (1.5.2)
pytest (3.4.2)
setuptools (38.5.2)
six (1.11.0)
wheel (0.30.0)
OS: Ubuntu 16.04.4 LTS
Metadata
Metadata
Assignees
Labels
plugin: monkeypatchrelated to the monkeypatch builtin pluginrelated to the monkeypatch builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed