Bug 1389517 - Make Python warnings fatal during pytest runs

This makes most warning types (including the normally hidden
`DeprecatonWarning`s) fatal during pytest runs, to help prevent
regressions now that most of them have been fixed.

See:
https://docs.pytest.org/en/latest/warnings.html
https://docs.python.org/2.7/library/warnings.html#warning-categories
This commit is contained in:
Ed Morley 2018-04-11 02:22:14 +01:00
Родитель 4dee8425d9
Коммит 36f0a71e03
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -31,6 +31,17 @@ norecursedirs = __pycache__ jenkins ui
DJANGO_SETTINGS_MODULE=tests.settings
# Disable unused auto-loaded plugins.
addopts = --driver Firefox -p no:mozlog -p no:metadata -p no:html
# Make most warnings fatal (including the hidden by default DeprecationWarning):
# https://docs.pytest.org/en/latest/warnings.html
# https://docs.python.org/2.7/library/warnings.html#warning-categories
# Note that some warnings are currently missed by pytest:
# https://github.com/pytest-dev/pytest/issues/3251
filterwarnings =
error
# TODO: Fix usages of `selenium` and remove this override.
default:use driver instead:DeprecationWarning:pypom.view
ignore::ImportWarning
ignore::PendingDeprecationWarning
markers =
slow: mark a test as slow.
xfail_strict = true