Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error during teardown on skipping tests. #10

Closed
aodag opened this issue Feb 19, 2019 · 3 comments · Fixed by #12
Closed

error during teardown on skipping tests. #10

aodag opened this issue Feb 19, 2019 · 3 comments · Fixed by #12

Comments

@aodag
Copy link

aodag commented Feb 19, 2019

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.

see pytest-dev/pytest#3385

___________________________________________________________________________________________ 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'
@GertBurger
Copy link

This issue is creating many phantom build failures for us. Is anything keeping the PR from landing?

@f213
Copy link
Contributor

f213 commented Jan 28, 2021

@getsentry any updates on the PR?

@stuaxo
Copy link

stuaxo commented Feb 2, 2021

@f213 your fix definitely works, it means I can now run my tests in parallel with a combination of pytest-xdist and pytest-run :)

chadwhitacre added a commit that referenced this issue Apr 22, 2021
@chadwhitacre chadwhitacre changed the title error during teadorn on skipping tests. error during teadown on skipping tests. Apr 23, 2021
@chadwhitacre chadwhitacre changed the title error during teadown on skipping tests. error during teardown on skipping tests. Apr 23, 2021
stuaxo added a commit to uktrade/tamato that referenced this issue Jul 15, 2021
stuaxo added a commit to uktrade/tamato that referenced this issue Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants