getsentry / pytest-responses

py.test integration for responses
Apache License 2.0
89 stars 16 forks source link

Compatibility fixes for Pytest 4.0 #7

Closed mixja closed 3 years ago

mixja commented 5 years ago

This PR adds compatibility with pytest version 4.0.

Currently pytest-responses does not work with pytest 4.x with the following error raised for each test:

def pytest_runtest_setup(item):
>       if not item.get_marker('withoutresponses'):
E       AttributeError: 'Function' object has no attribute 'get_marker'

The get_marker function has been removed as per https://github.com/pytest-dev/pytest/issues/4546, and this PR replaces this with the get_closest_marker function.

MRigal commented 5 years ago

I guess can be closed as addressed through #9