Use recwarn everywhere

...instead of custom fixture. Also assert that no warnings are left over
after the test.
This commit is contained in:
Markus Unterwaditzer 2016-06-03 13:56:42 +02:00
parent 047efac537
commit d393597c50
5 changed files with 110 additions and 92 deletions

View file

@ -20,6 +20,18 @@ except ImportError:
from flask._compat import PY2
@pytest.fixture(autouse=True)
def disable_extwarnings(request, recwarn):
from flask.exthook import ExtDeprecationWarning
def inner():
assert set(w.category for w in recwarn.list) \
<= set([ExtDeprecationWarning])
recwarn.clear()
request.addfinalizer(inner)
@pytest.fixture(autouse=True)
def importhook_setup(monkeypatch, request):
# we clear this out for various reasons. The most important one is