Test warnings with filter always on

This commit is contained in:
Matthias 2020-03-24 20:10:15 +01:00
parent 030c487d6b
commit be41981ef0

View File

@ -73,6 +73,7 @@ def test__args_to_config(caplog):
configuration = Configuration(args)
config = {}
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
# No warnings ...
configuration._args_to_config(config, argname="strategy_path", logstring="DeadBeef")
assert len(w) == 0
@ -82,6 +83,7 @@ def test__args_to_config(caplog):
configuration = Configuration(args)
config = {}
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
# Deprecation warnings!
configuration._args_to_config(config, argname="strategy_path", logstring="DeadBeef",
deprecated_msg="Going away soon!")