Merge pull request #3110 from freqtrade/fix_random_test

[minor] Test warnings with filter always on
This commit is contained in:
Matthias 2020-03-25 08:32:45 +01:00 committed by GitHub
commit 4ea6f9d7eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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