Use recwarn everywhere
...instead of custom fixture. Also assert that no warnings are left over after the test.
This commit is contained in:
parent
047efac537
commit
d393597c50
5 changed files with 110 additions and 92 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue