Skip to content

error during teardown on skipping tests.

Closed

Description

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions