Closed windiana42 closed 1 year ago
This is completely expected. The exception you see is raised by the pytest-mock
library. Its formating has nothing to do with PipeDAG.
You can replicate the same error message by running the following piece of code with pytest:
def test_mock_assert(mocker):
class Foo:
def fn(self, x):
return f"x = {x}"
obj = Foo()
spy = mocker.spy(obj, "fn")
obj.fn("Test")
spy.assert_not_called()
@NMAC427 I think pytest is great technology. But it makes development -- in case you know how to replicate what it does as library or in user space -- not always easier.
Even the call-stack is plain wrong: (line 254 is 1 blank line before test function)
tests/test_cache/test_basic_cache_invalidation.py:254 (test_change_lazy_query)
( x
0 1, 'x') != ()
Even the call-stack is plain wrong: (line 254 is 1 blank line before test function)
tests/test_cache/test_basic_cache_invalidation.py:254 (test_change_lazy_query) ( x 0 1, 'x') != ()
I believe that this is an issue with PyCharm. If I run a failing test case that uses the pytest-mock
asserts using PyCharm, I get the exact same behaviour of getting the wrong line number. However, when I call pytest
directly from the command line, I get a much better traceback with correct line numbers.
Good to know... I can confirm it works on command line.
Here is a random error which I just received: