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

@ -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