mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 16:43:06 +00:00
Clean up unclosed file handles
Close all file handles that are left dangling to avoid warnings such as
```
ResourceWarning: unclosed file <_io.TextIOWrapper
name='...' mode='r' encoding='UTF-8'> params = json_load(filename.open('r'))
```
This commit is contained in:
@@ -209,7 +209,8 @@ def test_export_params(tmpdir):
|
||||
|
||||
assert filename.is_file()
|
||||
|
||||
content = rapidjson.load(filename.open('r'))
|
||||
with filename.open('r') as f:
|
||||
content = rapidjson.load(f)
|
||||
assert content['strategy_name'] == 'StrategyTestV2'
|
||||
assert 'params' in content
|
||||
assert "buy" in content["params"]
|
||||
|
||||
Reference in New Issue
Block a user