error during teardown on skipping tests.
aodag opened this issue · comments
Atsushi Odagiri commented
if first test was skipped, we got error in teardown for pytest_responses.
because pytest_runtest_setup is not called on skipping tests but pytest_runtest_teardown is called.
___________________________________________________________________________________________ ERROR at teardown of test1 ____________________________________________________________________________________________
item = <Function test1>
def pytest_runtest_teardown(item):
if not get_withoutresponses_marker(item):
try:
> responses_.stop()
../../.local/share/virtualenvs/pytest_sample-j3KXi7ce/lib/python3.7/site-packages/pytest_responses.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <responses.RequestsMock object at 0x7fe17f370d30>, allow_assert = True
def stop(self, allow_assert=True):
> self._patcher.stop()
E AttributeError: 'RequestsMock' object has no attribute '_patcher'
Gert Burger commented
This issue is creating many phantom build failures for us. Is anything keeping the PR from landing?
Fedor Borshev commented
@getsentry any updates on the PR?
Stuart Axon commented
@f213 your fix definitely works, it means I can now run my tests in parallel with a combination of pytest-xdist and pytest-run :)