Skip to content

error during teardown on skipping tests. #10

Closed

Description

@aodag

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'

Activity

  1. GertBurger commented on Aug 6, 2020

    @GertBurger

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

  2. f213 commented on Jan 28, 2021

    @f213
    Contributor

    @getsentry any updates on the PR?

  3. stuaxo commented on Feb 2, 2021

    @stuaxo

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

  4. added a commit that references this issue on Apr 22, 2021
  5. changed the title [-]error during teadorn on skipping tests.[/-] [+]error during teadown on skipping tests.[/+] on Apr 23, 2021
  6. changed the title [-]error during teadown on skipping tests.[/-] [+]error during teardown on skipping tests.[/+] on Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions