Todd Sifleet
Todd Sifleet
It looks like travis-ci is dead? Is anyone still maintaining doubles at Uber?
@charlax here is an example: ``` import my_module def my_code_under_test(): my_module.some_method(2) def test_my_code(): allow(my_module).some_method.with_args(1).and_raise(Exception('Foobar')) with pytest.raises(Exception): my_code_under_test() ``` This test would pass but should clearly fail because `my_module.some_method` is called...
Doubles would not catch the exception, it would keep track that the UnallowedMethodCallError (or any doubles exception) was raised and then fail the test during cleanup.
@charlax @jmaliksi I hope all is well! I was already thinking of forking this because I ran into some other issues (see #148). I will get a new fork up...
@charlax @jmaliksi [dobles](https://github.com/smartfastlabs/dobles) has been launched. It is just at feature parity now, I'll work on improving all the async stuff this week.
You want to use the context manager within the test. If you do: ` import depthai as dai from models.device import Device from doubles import InstanceDouble, allow, no_builtin_verification import functools...
@thedrow what do you mean by "indeed doesn't support partial doubles"? Do you have an example?
I'm not sure this will solve the problem, because we get errors like `AttributeError: 'UserWithSlots' object attribute 'arbitrary_callable' is read-only` I have to think more about how to support objects...
Currently the only way to do this would be to mock **enter**/**exit** manually on your object double. e.g. ``` expect(d).__enter__ expect(d).__exit__ ``` I need to think a little bit if...
@markuswustenberg I couldn't think of a good way to do this...but I something like this would work: ``` from contextlib import contextmanager from doubles import expect, ObjectDouble class Stats(object): @contextmanager...