Ignore inspect.getargspec() warning during tests.
https://github.com/pytest-dev/pytest-bdd/issues/153
This commit is contained in:
parent
670a4d274b
commit
7d17957e90
@ -335,6 +335,10 @@ def py_proc():
|
|||||||
@pytest.yield_fixture(autouse=True)
|
@pytest.yield_fixture(autouse=True)
|
||||||
def fail_tests_on_warnings():
|
def fail_tests_on_warnings():
|
||||||
warnings.simplefilter('error')
|
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
|
yield
|
||||||
warnings.resetwarnings()
|
warnings.resetwarnings()
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
|
import inspect
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -38,3 +39,8 @@ def test_no_qapp(request):
|
|||||||
def test_fail_on_warnings():
|
def test_fail_on_warnings():
|
||||||
with pytest.raises(PendingDeprecationWarning):
|
with pytest.raises(PendingDeprecationWarning):
|
||||||
warnings.warn('test', PendingDeprecationWarning)
|
warnings.warn('test', PendingDeprecationWarning)
|
||||||
|
|
||||||
|
|
||||||
|
def test_getargspec():
|
||||||
|
"""Make sure the getargspec DeprecationWarning gets ignored."""
|
||||||
|
inspect.getargspec(lambda: None)
|
||||||
|
Loading…
Reference in New Issue
Block a user