diff --git a/tests/conftest.py b/tests/conftest.py index 08e600b2a..6ca235383 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -335,6 +335,10 @@ def py_proc(): @pytest.yield_fixture(autouse=True) def fail_tests_on_warnings(): warnings.simplefilter('error') + # https://github.com/pytest-dev/pytest-bdd/issues/153 + warnings.filterwarnings('ignore', message=r'inspect.getargspec\(\) is ' + r'deprecated, use inspect.signature\(\) instead', + category=DeprecationWarning) yield warnings.resetwarnings() diff --git a/tests/test_conftest.py b/tests/test_conftest.py index 0af725f30..4984b7efe 100644 --- a/tests/test_conftest.py +++ b/tests/test_conftest.py @@ -21,6 +21,7 @@ import warnings +import inspect import pytest @@ -38,3 +39,8 @@ def test_no_qapp(request): def test_fail_on_warnings(): with pytest.raises(PendingDeprecationWarning): warnings.warn('test', PendingDeprecationWarning) + + +def test_getargspec(): + """Make sure the getargspec DeprecationWarning gets ignored.""" + inspect.getargspec(lambda: None)