-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Context
Every time I try to mock a function from an external library (depthai in my case), I got the following error:
ValueError: no signature found for builtin <instancemethod getIrDrivers at 0x102b0b400>
/usr/local/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/inspect.py:2328: ValueError
The above exception was the direct cause of the following exception: [...]
TypeError: unsupported callable
During handling of the above exception, another exception occurred: [...]
doubles.exceptions.VerifyingBuiltinDoubleArgumentError: unsupported callable
What I tried
In the FAQ, I read this section which explains how to bypass the inspection functionality, by using with no_builtin_verification().
This is what I tried, by it doesn't fix the issue.
My code
import depthai as dai
from models.device import Device
from doubles import InstanceDouble, allow, no_builtin_verification
import functools
class TestDevice:
with no_builtin_verification():
allow(functools).reduce
def test_when_camera_has_no_ir_projector(self):
dai_device = InstanceDouble('depthai.Device')
allow(dai_device).getIrDrivers.and_return([])
device = Device(dai_device, 300)
assert device.dai_device == dai_deviceSetup
- Platform: MacOS
- Python 3.11.5
- pytest-7.4.2, pluggy-1.3.0
- doubles-1.5.3
Any idea?
I'm even sure if I'm using the with no_builtin_verification() properly.' 🤔
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels