Merge pull request #923 from freqtrade/fix_test_hyperopt
fix hyperopt test when no config.json exists
This commit is contained in:
commit
c608f1e21e
@ -16,15 +16,16 @@ install:
|
|||||||
- pip install --upgrade flake8 coveralls pytest-random-order mypy
|
- pip install --upgrade flake8 coveralls pytest-random-order mypy
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- pip install -e .
|
- pip install -e .
|
||||||
- cp config.json.example config.json
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- script:
|
- script:
|
||||||
- pytest --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/
|
- pytest --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/
|
||||||
- coveralls
|
- coveralls
|
||||||
- script:
|
- script:
|
||||||
|
- cp config.json.example config.json
|
||||||
- python freqtrade/main.py --datadir freqtrade/tests/testdata backtesting
|
- python freqtrade/main.py --datadir freqtrade/tests/testdata backtesting
|
||||||
- script:
|
- script:
|
||||||
|
- cp config.json.example config.json
|
||||||
- python freqtrade/main.py --datadir freqtrade/tests/testdata hyperopt -e 5
|
- python freqtrade/main.py --datadir freqtrade/tests/testdata hyperopt -e 5
|
||||||
- script: flake8 freqtrade
|
- script: flake8 freqtrade
|
||||||
- script: mypy freqtrade
|
- script: mypy freqtrade
|
||||||
|
@ -61,6 +61,10 @@ def test_start(mocker, default_conf, caplog) -> None:
|
|||||||
Test start() function
|
Test start() function
|
||||||
"""
|
"""
|
||||||
start_mock = MagicMock()
|
start_mock = MagicMock()
|
||||||
|
mocker.patch(
|
||||||
|
'freqtrade.configuration.Configuration._load_config_file',
|
||||||
|
lambda *args, **kwargs: default_conf
|
||||||
|
)
|
||||||
mocker.patch('freqtrade.optimize.hyperopt.Hyperopt.start', start_mock)
|
mocker.patch('freqtrade.optimize.hyperopt.Hyperopt.start', start_mock)
|
||||||
mocker.patch('freqtrade.freqtradebot.exchange.validate_pairs', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.exchange.validate_pairs', MagicMock())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user