forked from orbit-oss/flask
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
|
|
@ -126,8 +126,7 @@ def purge_module(request):
|
|||
return inner
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def catch_deprecation_warnings():
|
||||
import warnings
|
||||
warnings.simplefilter('default', category=DeprecationWarning)
|
||||
return lambda: warnings.catch_warnings(record=True)
|
||||
@pytest.yield_fixture(autouse=True)
|
||||
def catch_deprecation_warnings(recwarn):
|
||||
yield
|
||||
assert not recwarn.list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue