tests: Use pytest-warnings to handle warnings
This commit is contained in:
parent
1ebf2bab1c
commit
7605a4fb0c
@ -26,6 +26,7 @@ pytest-qt==1.11.0
|
|||||||
pytest-repeat==0.3.0
|
pytest-repeat==0.3.0
|
||||||
pytest-rerunfailures==2.0.0
|
pytest-rerunfailures==2.0.0
|
||||||
pytest-travis-fold==1.2.0
|
pytest-travis-fold==1.2.0
|
||||||
|
pytest-warnings==0.1.0
|
||||||
pytest-xvfb==0.2.0
|
pytest-xvfb==0.2.0
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
vulture==0.10
|
vulture==0.10
|
||||||
|
@ -15,6 +15,7 @@ pytest-qt
|
|||||||
pytest-repeat
|
pytest-repeat
|
||||||
pytest-rerunfailures
|
pytest-rerunfailures
|
||||||
pytest-travis-fold
|
pytest-travis-fold
|
||||||
|
pytest-warnings
|
||||||
pytest-xvfb
|
pytest-xvfb
|
||||||
vulture
|
vulture
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[pytest]
|
[pytest]
|
||||||
addopts = --strict -rfEw --faulthandler-timeout=70 --instafail
|
addopts = --strict -rfEw --faulthandler-timeout=70 --instafail --pythonwarnings error
|
||||||
markers =
|
markers =
|
||||||
gui: Tests using the GUI (e.g. spawning widgets)
|
gui: Tests using the GUI (e.g. spawning widgets)
|
||||||
posix: Tests which only can run on a POSIX OS.
|
posix: Tests which only can run on a POSIX OS.
|
||||||
|
@ -133,13 +133,6 @@ def qapp(qapp):
|
|||||||
return qapp
|
return qapp
|
||||||
|
|
||||||
|
|
||||||
@pytest.yield_fixture(autouse=True)
|
|
||||||
def fail_tests_on_warnings():
|
|
||||||
warnings.simplefilter('error')
|
|
||||||
yield
|
|
||||||
warnings.resetwarnings()
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
parser.addoption('--qute-delay', action='store', default=0, type=int,
|
parser.addoption('--qute-delay', action='store', default=0, type=int,
|
||||||
help="Delay between qutebrowser commands.")
|
help="Delay between qutebrowser commands.")
|
||||||
|
Loading…
Reference in New Issue
Block a user