From 7564f7e526cfa8a1f8bf04155d26e3e9e9eadade Mon Sep 17 00:00:00 2001 From: xmatthias Date: Sat, 16 Jun 2018 13:49:03 +0200 Subject: [PATCH 1/2] fix hyperopt test when no config.json exists --- freqtrade/tests/optimize/test_hyperopt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/freqtrade/tests/optimize/test_hyperopt.py index f8dce5fd6..9b66a29e2 100644 --- a/freqtrade/tests/optimize/test_hyperopt.py +++ b/freqtrade/tests/optimize/test_hyperopt.py @@ -61,6 +61,10 @@ def test_start(mocker, default_conf, caplog) -> None: Test start() function """ 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.freqtradebot.exchange.validate_pairs', MagicMock()) From ad0549414b7434fbd31841dbffe36dbd34dce1ac Mon Sep 17 00:00:00 2001 From: xmatthias Date: Sun, 17 Jun 2018 11:34:12 +0200 Subject: [PATCH 2/2] Revert "also unit tests now need config.json" This reverts commit 7e2e7946c5b12abffd222420d74156208ef41e59. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3f041f5dd..88121945f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,16 @@ install: - pip install --upgrade flake8 coveralls pytest-random-order mypy - pip install -r requirements.txt - pip install -e . -- cp config.json.example config.json jobs: include: - script: - pytest --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/ - coveralls - script: + - cp config.json.example config.json - python freqtrade/main.py --datadir freqtrade/tests/testdata backtesting - script: + - cp config.json.example config.json - python freqtrade/main.py --datadir freqtrade/tests/testdata hyperopt -e 5 - script: flake8 freqtrade - script: mypy freqtrade