From 65a516e2298089fd50798dc5445f8c0f0e23609c Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 09:42:28 +0200 Subject: [PATCH 1/7] Move tests out of freqtrade module --- {freqtrade/tests => tests}/__init__.py | 0 .../tests => tests}/config_test_comments.json | 0 {freqtrade/tests => tests}/conftest.py | 0 {freqtrade/tests => tests}/data/__init__.py | 0 {freqtrade/tests => tests}/data/test_btanalysis.py | 0 {freqtrade/tests => tests}/data/test_converter.py | 0 .../tests => tests}/data/test_dataprovider.py | 0 {freqtrade/tests => tests}/data/test_history.py | 0 {freqtrade/tests => tests}/edge/__init__.py | 0 {freqtrade/tests => tests}/edge/test_edge.py | 0 {freqtrade/tests => tests}/exchange/__init__.py | 0 {freqtrade/tests => tests}/exchange/test_binance.py | 0 .../tests => tests}/exchange/test_exchange.py | 0 {freqtrade/tests => tests}/exchange/test_kraken.py | 0 {freqtrade/tests => tests}/optimize/__init__.py | 0 .../optimize/test_backtest_detail.py | 0 .../tests => tests}/optimize/test_backtesting.py | 0 .../tests => tests}/optimize/test_edge_cli.py | 0 .../tests => tests}/optimize/test_hyperopt.py | 0 {freqtrade/tests => tests}/pairlist/__init__.py | 0 .../tests => tests}/pairlist/test_pairlist.py | 0 {freqtrade/tests => tests}/rpc/__init__.py | 0 {freqtrade/tests => tests}/rpc/test_fiat_convert.py | 0 {freqtrade/tests => tests}/rpc/test_rpc.py | 0 .../tests => tests}/rpc/test_rpc_apiserver.py | 0 {freqtrade/tests => tests}/rpc/test_rpc_manager.py | 0 {freqtrade/tests => tests}/rpc/test_rpc_telegram.py | 0 {freqtrade/tests => tests}/rpc/test_rpc_webhook.py | 0 {freqtrade/tests => tests}/strategy/__init__.py | 0 .../tests => tests}/strategy/legacy_strategy.py | 0 .../strategy/test_default_strategy.py | 0 .../tests => tests}/strategy/test_interface.py | 0 .../tests => tests}/strategy/test_strategy.py | 0 {freqtrade/tests => tests}/test_arguments.py | 0 {freqtrade/tests => tests}/test_configuration.py | 0 {freqtrade/tests => tests}/test_freqtradebot.py | 0 .../tests => tests}/test_indicator_helpers.py | 0 {freqtrade/tests => tests}/test_main.py | 0 {freqtrade/tests => tests}/test_misc.py | 0 {freqtrade/tests => tests}/test_persistence.py | 0 {freqtrade/tests => tests}/test_plotting.py | 0 {freqtrade/tests => tests}/test_talib.py | 0 {freqtrade/tests => tests}/test_timerange.py | 0 {freqtrade/tests => tests}/test_utils.py | 0 {freqtrade/tests => tests}/test_wallets.py | 0 {freqtrade/tests => tests}/testdata/ADA_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/ADA_BTC-5m.json | 0 .../tests => tests}/testdata/DASH_BTC-1m.json | 0 .../tests => tests}/testdata/DASH_BTC-5m.json | 0 {freqtrade/tests => tests}/testdata/ETC_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/ETC_BTC-5m.json | 0 {freqtrade/tests => tests}/testdata/ETH_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/ETH_BTC-5m.json | 0 {freqtrade/tests => tests}/testdata/LTC_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/LTC_BTC-5m.json | 0 {freqtrade/tests => tests}/testdata/NXT_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/NXT_BTC-5m.json | 0 .../tests => tests}/testdata/POWR_BTC-1m.json | 0 .../tests => tests}/testdata/POWR_BTC-5m.json | 0 .../tests => tests}/testdata/UNITTEST_BTC-1m.json | 0 .../tests => tests}/testdata/UNITTEST_BTC-30m.json | 0 .../tests => tests}/testdata/UNITTEST_BTC-5m.json | 0 .../tests => tests}/testdata/UNITTEST_BTC-8m.json | 0 .../testdata/UNITTEST_BTC-8m.json.gz | Bin {freqtrade/tests => tests}/testdata/XLM_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/XLM_BTC-5m.json | 0 {freqtrade/tests => tests}/testdata/XMR_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/XMR_BTC-5m.json | 0 {freqtrade/tests => tests}/testdata/ZEC_BTC-1m.json | 0 {freqtrade/tests => tests}/testdata/ZEC_BTC-5m.json | 0 .../testdata/backtest-result_test.json | 0 {freqtrade/tests => tests}/testdata/pairs.json | 0 72 files changed, 0 insertions(+), 0 deletions(-) rename {freqtrade/tests => tests}/__init__.py (100%) rename {freqtrade/tests => tests}/config_test_comments.json (100%) rename {freqtrade/tests => tests}/conftest.py (100%) rename {freqtrade/tests => tests}/data/__init__.py (100%) rename {freqtrade/tests => tests}/data/test_btanalysis.py (100%) rename {freqtrade/tests => tests}/data/test_converter.py (100%) rename {freqtrade/tests => tests}/data/test_dataprovider.py (100%) rename {freqtrade/tests => tests}/data/test_history.py (100%) rename {freqtrade/tests => tests}/edge/__init__.py (100%) rename {freqtrade/tests => tests}/edge/test_edge.py (100%) rename {freqtrade/tests => tests}/exchange/__init__.py (100%) rename {freqtrade/tests => tests}/exchange/test_binance.py (100%) rename {freqtrade/tests => tests}/exchange/test_exchange.py (100%) rename {freqtrade/tests => tests}/exchange/test_kraken.py (100%) rename {freqtrade/tests => tests}/optimize/__init__.py (100%) rename {freqtrade/tests => tests}/optimize/test_backtest_detail.py (100%) rename {freqtrade/tests => tests}/optimize/test_backtesting.py (100%) rename {freqtrade/tests => tests}/optimize/test_edge_cli.py (100%) rename {freqtrade/tests => tests}/optimize/test_hyperopt.py (100%) rename {freqtrade/tests => tests}/pairlist/__init__.py (100%) rename {freqtrade/tests => tests}/pairlist/test_pairlist.py (100%) rename {freqtrade/tests => tests}/rpc/__init__.py (100%) rename {freqtrade/tests => tests}/rpc/test_fiat_convert.py (100%) rename {freqtrade/tests => tests}/rpc/test_rpc.py (100%) rename {freqtrade/tests => tests}/rpc/test_rpc_apiserver.py (100%) rename {freqtrade/tests => tests}/rpc/test_rpc_manager.py (100%) rename {freqtrade/tests => tests}/rpc/test_rpc_telegram.py (100%) rename {freqtrade/tests => tests}/rpc/test_rpc_webhook.py (100%) rename {freqtrade/tests => tests}/strategy/__init__.py (100%) rename {freqtrade/tests => tests}/strategy/legacy_strategy.py (100%) rename {freqtrade/tests => tests}/strategy/test_default_strategy.py (100%) rename {freqtrade/tests => tests}/strategy/test_interface.py (100%) rename {freqtrade/tests => tests}/strategy/test_strategy.py (100%) rename {freqtrade/tests => tests}/test_arguments.py (100%) rename {freqtrade/tests => tests}/test_configuration.py (100%) rename {freqtrade/tests => tests}/test_freqtradebot.py (100%) rename {freqtrade/tests => tests}/test_indicator_helpers.py (100%) rename {freqtrade/tests => tests}/test_main.py (100%) rename {freqtrade/tests => tests}/test_misc.py (100%) rename {freqtrade/tests => tests}/test_persistence.py (100%) rename {freqtrade/tests => tests}/test_plotting.py (100%) rename {freqtrade/tests => tests}/test_talib.py (100%) rename {freqtrade/tests => tests}/test_timerange.py (100%) rename {freqtrade/tests => tests}/test_utils.py (100%) rename {freqtrade/tests => tests}/test_wallets.py (100%) rename {freqtrade/tests => tests}/testdata/ADA_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/ADA_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/DASH_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/DASH_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/ETC_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/ETC_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/ETH_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/ETH_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/LTC_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/LTC_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/NXT_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/NXT_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/POWR_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/POWR_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/UNITTEST_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/UNITTEST_BTC-30m.json (100%) rename {freqtrade/tests => tests}/testdata/UNITTEST_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/UNITTEST_BTC-8m.json (100%) rename {freqtrade/tests => tests}/testdata/UNITTEST_BTC-8m.json.gz (100%) rename {freqtrade/tests => tests}/testdata/XLM_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/XLM_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/XMR_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/XMR_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/ZEC_BTC-1m.json (100%) rename {freqtrade/tests => tests}/testdata/ZEC_BTC-5m.json (100%) rename {freqtrade/tests => tests}/testdata/backtest-result_test.json (100%) rename {freqtrade/tests => tests}/testdata/pairs.json (100%) diff --git a/freqtrade/tests/__init__.py b/tests/__init__.py similarity index 100% rename from freqtrade/tests/__init__.py rename to tests/__init__.py diff --git a/freqtrade/tests/config_test_comments.json b/tests/config_test_comments.json similarity index 100% rename from freqtrade/tests/config_test_comments.json rename to tests/config_test_comments.json diff --git a/freqtrade/tests/conftest.py b/tests/conftest.py similarity index 100% rename from freqtrade/tests/conftest.py rename to tests/conftest.py diff --git a/freqtrade/tests/data/__init__.py b/tests/data/__init__.py similarity index 100% rename from freqtrade/tests/data/__init__.py rename to tests/data/__init__.py diff --git a/freqtrade/tests/data/test_btanalysis.py b/tests/data/test_btanalysis.py similarity index 100% rename from freqtrade/tests/data/test_btanalysis.py rename to tests/data/test_btanalysis.py diff --git a/freqtrade/tests/data/test_converter.py b/tests/data/test_converter.py similarity index 100% rename from freqtrade/tests/data/test_converter.py rename to tests/data/test_converter.py diff --git a/freqtrade/tests/data/test_dataprovider.py b/tests/data/test_dataprovider.py similarity index 100% rename from freqtrade/tests/data/test_dataprovider.py rename to tests/data/test_dataprovider.py diff --git a/freqtrade/tests/data/test_history.py b/tests/data/test_history.py similarity index 100% rename from freqtrade/tests/data/test_history.py rename to tests/data/test_history.py diff --git a/freqtrade/tests/edge/__init__.py b/tests/edge/__init__.py similarity index 100% rename from freqtrade/tests/edge/__init__.py rename to tests/edge/__init__.py diff --git a/freqtrade/tests/edge/test_edge.py b/tests/edge/test_edge.py similarity index 100% rename from freqtrade/tests/edge/test_edge.py rename to tests/edge/test_edge.py diff --git a/freqtrade/tests/exchange/__init__.py b/tests/exchange/__init__.py similarity index 100% rename from freqtrade/tests/exchange/__init__.py rename to tests/exchange/__init__.py diff --git a/freqtrade/tests/exchange/test_binance.py b/tests/exchange/test_binance.py similarity index 100% rename from freqtrade/tests/exchange/test_binance.py rename to tests/exchange/test_binance.py diff --git a/freqtrade/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py similarity index 100% rename from freqtrade/tests/exchange/test_exchange.py rename to tests/exchange/test_exchange.py diff --git a/freqtrade/tests/exchange/test_kraken.py b/tests/exchange/test_kraken.py similarity index 100% rename from freqtrade/tests/exchange/test_kraken.py rename to tests/exchange/test_kraken.py diff --git a/freqtrade/tests/optimize/__init__.py b/tests/optimize/__init__.py similarity index 100% rename from freqtrade/tests/optimize/__init__.py rename to tests/optimize/__init__.py diff --git a/freqtrade/tests/optimize/test_backtest_detail.py b/tests/optimize/test_backtest_detail.py similarity index 100% rename from freqtrade/tests/optimize/test_backtest_detail.py rename to tests/optimize/test_backtest_detail.py diff --git a/freqtrade/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py similarity index 100% rename from freqtrade/tests/optimize/test_backtesting.py rename to tests/optimize/test_backtesting.py diff --git a/freqtrade/tests/optimize/test_edge_cli.py b/tests/optimize/test_edge_cli.py similarity index 100% rename from freqtrade/tests/optimize/test_edge_cli.py rename to tests/optimize/test_edge_cli.py diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py similarity index 100% rename from freqtrade/tests/optimize/test_hyperopt.py rename to tests/optimize/test_hyperopt.py diff --git a/freqtrade/tests/pairlist/__init__.py b/tests/pairlist/__init__.py similarity index 100% rename from freqtrade/tests/pairlist/__init__.py rename to tests/pairlist/__init__.py diff --git a/freqtrade/tests/pairlist/test_pairlist.py b/tests/pairlist/test_pairlist.py similarity index 100% rename from freqtrade/tests/pairlist/test_pairlist.py rename to tests/pairlist/test_pairlist.py diff --git a/freqtrade/tests/rpc/__init__.py b/tests/rpc/__init__.py similarity index 100% rename from freqtrade/tests/rpc/__init__.py rename to tests/rpc/__init__.py diff --git a/freqtrade/tests/rpc/test_fiat_convert.py b/tests/rpc/test_fiat_convert.py similarity index 100% rename from freqtrade/tests/rpc/test_fiat_convert.py rename to tests/rpc/test_fiat_convert.py diff --git a/freqtrade/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py similarity index 100% rename from freqtrade/tests/rpc/test_rpc.py rename to tests/rpc/test_rpc.py diff --git a/freqtrade/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py similarity index 100% rename from freqtrade/tests/rpc/test_rpc_apiserver.py rename to tests/rpc/test_rpc_apiserver.py diff --git a/freqtrade/tests/rpc/test_rpc_manager.py b/tests/rpc/test_rpc_manager.py similarity index 100% rename from freqtrade/tests/rpc/test_rpc_manager.py rename to tests/rpc/test_rpc_manager.py diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py similarity index 100% rename from freqtrade/tests/rpc/test_rpc_telegram.py rename to tests/rpc/test_rpc_telegram.py diff --git a/freqtrade/tests/rpc/test_rpc_webhook.py b/tests/rpc/test_rpc_webhook.py similarity index 100% rename from freqtrade/tests/rpc/test_rpc_webhook.py rename to tests/rpc/test_rpc_webhook.py diff --git a/freqtrade/tests/strategy/__init__.py b/tests/strategy/__init__.py similarity index 100% rename from freqtrade/tests/strategy/__init__.py rename to tests/strategy/__init__.py diff --git a/freqtrade/tests/strategy/legacy_strategy.py b/tests/strategy/legacy_strategy.py similarity index 100% rename from freqtrade/tests/strategy/legacy_strategy.py rename to tests/strategy/legacy_strategy.py diff --git a/freqtrade/tests/strategy/test_default_strategy.py b/tests/strategy/test_default_strategy.py similarity index 100% rename from freqtrade/tests/strategy/test_default_strategy.py rename to tests/strategy/test_default_strategy.py diff --git a/freqtrade/tests/strategy/test_interface.py b/tests/strategy/test_interface.py similarity index 100% rename from freqtrade/tests/strategy/test_interface.py rename to tests/strategy/test_interface.py diff --git a/freqtrade/tests/strategy/test_strategy.py b/tests/strategy/test_strategy.py similarity index 100% rename from freqtrade/tests/strategy/test_strategy.py rename to tests/strategy/test_strategy.py diff --git a/freqtrade/tests/test_arguments.py b/tests/test_arguments.py similarity index 100% rename from freqtrade/tests/test_arguments.py rename to tests/test_arguments.py diff --git a/freqtrade/tests/test_configuration.py b/tests/test_configuration.py similarity index 100% rename from freqtrade/tests/test_configuration.py rename to tests/test_configuration.py diff --git a/freqtrade/tests/test_freqtradebot.py b/tests/test_freqtradebot.py similarity index 100% rename from freqtrade/tests/test_freqtradebot.py rename to tests/test_freqtradebot.py diff --git a/freqtrade/tests/test_indicator_helpers.py b/tests/test_indicator_helpers.py similarity index 100% rename from freqtrade/tests/test_indicator_helpers.py rename to tests/test_indicator_helpers.py diff --git a/freqtrade/tests/test_main.py b/tests/test_main.py similarity index 100% rename from freqtrade/tests/test_main.py rename to tests/test_main.py diff --git a/freqtrade/tests/test_misc.py b/tests/test_misc.py similarity index 100% rename from freqtrade/tests/test_misc.py rename to tests/test_misc.py diff --git a/freqtrade/tests/test_persistence.py b/tests/test_persistence.py similarity index 100% rename from freqtrade/tests/test_persistence.py rename to tests/test_persistence.py diff --git a/freqtrade/tests/test_plotting.py b/tests/test_plotting.py similarity index 100% rename from freqtrade/tests/test_plotting.py rename to tests/test_plotting.py diff --git a/freqtrade/tests/test_talib.py b/tests/test_talib.py similarity index 100% rename from freqtrade/tests/test_talib.py rename to tests/test_talib.py diff --git a/freqtrade/tests/test_timerange.py b/tests/test_timerange.py similarity index 100% rename from freqtrade/tests/test_timerange.py rename to tests/test_timerange.py diff --git a/freqtrade/tests/test_utils.py b/tests/test_utils.py similarity index 100% rename from freqtrade/tests/test_utils.py rename to tests/test_utils.py diff --git a/freqtrade/tests/test_wallets.py b/tests/test_wallets.py similarity index 100% rename from freqtrade/tests/test_wallets.py rename to tests/test_wallets.py diff --git a/freqtrade/tests/testdata/ADA_BTC-1m.json b/tests/testdata/ADA_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/ADA_BTC-1m.json rename to tests/testdata/ADA_BTC-1m.json diff --git a/freqtrade/tests/testdata/ADA_BTC-5m.json b/tests/testdata/ADA_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/ADA_BTC-5m.json rename to tests/testdata/ADA_BTC-5m.json diff --git a/freqtrade/tests/testdata/DASH_BTC-1m.json b/tests/testdata/DASH_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/DASH_BTC-1m.json rename to tests/testdata/DASH_BTC-1m.json diff --git a/freqtrade/tests/testdata/DASH_BTC-5m.json b/tests/testdata/DASH_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/DASH_BTC-5m.json rename to tests/testdata/DASH_BTC-5m.json diff --git a/freqtrade/tests/testdata/ETC_BTC-1m.json b/tests/testdata/ETC_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/ETC_BTC-1m.json rename to tests/testdata/ETC_BTC-1m.json diff --git a/freqtrade/tests/testdata/ETC_BTC-5m.json b/tests/testdata/ETC_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/ETC_BTC-5m.json rename to tests/testdata/ETC_BTC-5m.json diff --git a/freqtrade/tests/testdata/ETH_BTC-1m.json b/tests/testdata/ETH_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/ETH_BTC-1m.json rename to tests/testdata/ETH_BTC-1m.json diff --git a/freqtrade/tests/testdata/ETH_BTC-5m.json b/tests/testdata/ETH_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/ETH_BTC-5m.json rename to tests/testdata/ETH_BTC-5m.json diff --git a/freqtrade/tests/testdata/LTC_BTC-1m.json b/tests/testdata/LTC_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/LTC_BTC-1m.json rename to tests/testdata/LTC_BTC-1m.json diff --git a/freqtrade/tests/testdata/LTC_BTC-5m.json b/tests/testdata/LTC_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/LTC_BTC-5m.json rename to tests/testdata/LTC_BTC-5m.json diff --git a/freqtrade/tests/testdata/NXT_BTC-1m.json b/tests/testdata/NXT_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/NXT_BTC-1m.json rename to tests/testdata/NXT_BTC-1m.json diff --git a/freqtrade/tests/testdata/NXT_BTC-5m.json b/tests/testdata/NXT_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/NXT_BTC-5m.json rename to tests/testdata/NXT_BTC-5m.json diff --git a/freqtrade/tests/testdata/POWR_BTC-1m.json b/tests/testdata/POWR_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/POWR_BTC-1m.json rename to tests/testdata/POWR_BTC-1m.json diff --git a/freqtrade/tests/testdata/POWR_BTC-5m.json b/tests/testdata/POWR_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/POWR_BTC-5m.json rename to tests/testdata/POWR_BTC-5m.json diff --git a/freqtrade/tests/testdata/UNITTEST_BTC-1m.json b/tests/testdata/UNITTEST_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/UNITTEST_BTC-1m.json rename to tests/testdata/UNITTEST_BTC-1m.json diff --git a/freqtrade/tests/testdata/UNITTEST_BTC-30m.json b/tests/testdata/UNITTEST_BTC-30m.json similarity index 100% rename from freqtrade/tests/testdata/UNITTEST_BTC-30m.json rename to tests/testdata/UNITTEST_BTC-30m.json diff --git a/freqtrade/tests/testdata/UNITTEST_BTC-5m.json b/tests/testdata/UNITTEST_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/UNITTEST_BTC-5m.json rename to tests/testdata/UNITTEST_BTC-5m.json diff --git a/freqtrade/tests/testdata/UNITTEST_BTC-8m.json b/tests/testdata/UNITTEST_BTC-8m.json similarity index 100% rename from freqtrade/tests/testdata/UNITTEST_BTC-8m.json rename to tests/testdata/UNITTEST_BTC-8m.json diff --git a/freqtrade/tests/testdata/UNITTEST_BTC-8m.json.gz b/tests/testdata/UNITTEST_BTC-8m.json.gz similarity index 100% rename from freqtrade/tests/testdata/UNITTEST_BTC-8m.json.gz rename to tests/testdata/UNITTEST_BTC-8m.json.gz diff --git a/freqtrade/tests/testdata/XLM_BTC-1m.json b/tests/testdata/XLM_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/XLM_BTC-1m.json rename to tests/testdata/XLM_BTC-1m.json diff --git a/freqtrade/tests/testdata/XLM_BTC-5m.json b/tests/testdata/XLM_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/XLM_BTC-5m.json rename to tests/testdata/XLM_BTC-5m.json diff --git a/freqtrade/tests/testdata/XMR_BTC-1m.json b/tests/testdata/XMR_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/XMR_BTC-1m.json rename to tests/testdata/XMR_BTC-1m.json diff --git a/freqtrade/tests/testdata/XMR_BTC-5m.json b/tests/testdata/XMR_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/XMR_BTC-5m.json rename to tests/testdata/XMR_BTC-5m.json diff --git a/freqtrade/tests/testdata/ZEC_BTC-1m.json b/tests/testdata/ZEC_BTC-1m.json similarity index 100% rename from freqtrade/tests/testdata/ZEC_BTC-1m.json rename to tests/testdata/ZEC_BTC-1m.json diff --git a/freqtrade/tests/testdata/ZEC_BTC-5m.json b/tests/testdata/ZEC_BTC-5m.json similarity index 100% rename from freqtrade/tests/testdata/ZEC_BTC-5m.json rename to tests/testdata/ZEC_BTC-5m.json diff --git a/freqtrade/tests/testdata/backtest-result_test.json b/tests/testdata/backtest-result_test.json similarity index 100% rename from freqtrade/tests/testdata/backtest-result_test.json rename to tests/testdata/backtest-result_test.json diff --git a/freqtrade/tests/testdata/pairs.json b/tests/testdata/pairs.json similarity index 100% rename from freqtrade/tests/testdata/pairs.json rename to tests/testdata/pairs.json From 26d76cdb196ec01e89d487610120c173d89879b2 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 09:54:15 +0200 Subject: [PATCH 2/7] Adjust imports in tests to new path --- tests/conftest.py | 4 ++-- tests/data/test_btanalysis.py | 2 +- tests/data/test_converter.py | 2 +- tests/data/test_dataprovider.py | 2 +- tests/data/test_history.py | 2 +- tests/edge/test_edge.py | 7 +++---- tests/exchange/test_binance.py | 2 +- tests/exchange/test_exchange.py | 2 +- tests/exchange/test_kraken.py | 2 +- tests/optimize/test_backtest_detail.py | 8 +++----- tests/optimize/test_backtesting.py | 17 ++++++++--------- tests/optimize/test_edge_cli.py | 5 ++--- tests/optimize/test_hyperopt.py | 14 +++++++------- tests/pairlist/test_pairlist.py | 2 +- tests/rpc/test_fiat_convert.py | 2 +- tests/rpc/test_rpc.py | 2 +- tests/rpc/test_rpc_apiserver.py | 4 +--- tests/rpc/test_rpc_manager.py | 2 +- tests/rpc/test_rpc_telegram.py | 4 ++-- tests/rpc/test_rpc_webhook.py | 2 +- tests/strategy/test_default_strategy.py | 11 ----------- tests/strategy/test_interface.py | 2 +- tests/strategy/test_strategy.py | 4 ++-- tests/test_configuration.py | 7 ++++--- tests/test_freqtradebot.py | 9 ++++----- tests/test_main.py | 2 +- tests/test_persistence.py | 2 +- tests/test_plotting.py | 2 +- tests/test_utils.py | 2 +- tests/test_wallets.py | 2 +- 30 files changed, 56 insertions(+), 74 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 81358e003..a007aeb7e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -891,8 +891,8 @@ def tickers(): @pytest.fixture -def result(): - with Path('freqtrade/tests/testdata/UNITTEST_BTC-1m.json').open('r') as data_file: +def result(testdatadir): + with (testdatadir / 'UNITTEST_BTC-1m.json').open('r') as data_file: return parse_ticker_dataframe(json.load(data_file), '1m', pair="UNITTEST/BTC", fill_missing=True) diff --git a/tests/data/test_btanalysis.py b/tests/data/test_btanalysis.py index e95757d4e..18326226c 100644 --- a/tests/data/test_btanalysis.py +++ b/tests/data/test_btanalysis.py @@ -12,7 +12,7 @@ from freqtrade.data.btanalysis import (BT_DATA_COLUMNS, load_backtest_data, load_trades, load_trades_from_db) from freqtrade.data.history import load_data, load_pair_history -from freqtrade.tests.test_persistence import create_mock_trades +from tests.test_persistence import create_mock_trades def test_load_backtest_data(testdatadir): diff --git a/tests/data/test_converter.py b/tests/data/test_converter.py index d47c3ee92..72da47e76 100644 --- a/tests/data/test_converter.py +++ b/tests/data/test_converter.py @@ -3,7 +3,7 @@ import logging from freqtrade.data.converter import parse_ticker_dataframe, ohlcv_fill_up_missing_data from freqtrade.data.history import load_pair_history, validate_backtest_data, get_timeframe -from freqtrade.tests.conftest import log_has +from tests.conftest import log_has def test_dataframe_correct_columns(result): diff --git a/tests/data/test_dataprovider.py b/tests/data/test_dataprovider.py index 441e242f8..ec176d889 100644 --- a/tests/data/test_dataprovider.py +++ b/tests/data/test_dataprovider.py @@ -4,7 +4,7 @@ from pandas import DataFrame from freqtrade.data.dataprovider import DataProvider from freqtrade.state import RunMode -from freqtrade.tests.conftest import get_patched_exchange +from tests.conftest import get_patched_exchange def test_ohlcv(mocker, default_conf, ticker_history): diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 252c73a4e..857967f39 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -22,7 +22,7 @@ from freqtrade.data.history import (download_pair_history, from freqtrade.exchange import timeframe_to_minutes from freqtrade.misc import file_dump_json from freqtrade.strategy.default_strategy import DefaultStrategy -from freqtrade.tests.conftest import get_patched_exchange, log_has, log_has_re, patch_exchange +from tests.conftest import get_patched_exchange, log_has, log_has_re, patch_exchange # Change this if modifying UNITTEST/BTC testdatafile _BTC_UNITTEST_LENGTH = 13681 diff --git a/tests/edge/test_edge.py b/tests/edge/test_edge.py index d30285a95..d5f282d7b 100644 --- a/tests/edge/test_edge.py +++ b/tests/edge/test_edge.py @@ -14,10 +14,9 @@ from freqtrade import OperationalException from freqtrade.data.converter import parse_ticker_dataframe from freqtrade.edge import Edge, PairInfo from freqtrade.strategy.interface import SellType -from freqtrade.tests.conftest import get_patched_freqtradebot, log_has -from freqtrade.tests.optimize import (BTContainer, BTrade, - _build_backtest_dataframe, - _get_frame_time_from_offset) +from tests.conftest import get_patched_freqtradebot, log_has +from tests.optimize import (BTContainer, BTrade, _build_backtest_dataframe, + _get_frame_time_from_offset) # Cases to be tested: # 1) Open trade should be removed from the end diff --git a/tests/exchange/test_binance.py b/tests/exchange/test_binance.py index 6518c8523..7720a7d2e 100644 --- a/tests/exchange/test_binance.py +++ b/tests/exchange/test_binance.py @@ -6,7 +6,7 @@ import pytest from freqtrade import (DependencyException, InvalidOrderException, OperationalException, TemporaryError) -from freqtrade.tests.conftest import get_patched_exchange +from tests.conftest import get_patched_exchange def test_stoploss_limit_order(default_conf, mocker): diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 1fd045f54..e23db42d2 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -20,7 +20,7 @@ from freqtrade.exchange.exchange import (API_RETRY_COUNT, timeframe_to_minutes, timeframe_to_prev_date, timeframe_to_seconds) from freqtrade.resolvers.exchange_resolver import ExchangeResolver -from freqtrade.tests.conftest import get_patched_exchange, log_has, log_has_re +from tests.conftest import get_patched_exchange, log_has, log_has_re # Make sure to always keep one exchange here which is NOT subclassed!! EXCHANGES = ['bittrex', 'binance', 'kraken', ] diff --git a/tests/exchange/test_kraken.py b/tests/exchange/test_kraken.py index 8f476affb..ba94f8b45 100644 --- a/tests/exchange/test_kraken.py +++ b/tests/exchange/test_kraken.py @@ -3,7 +3,7 @@ from random import randint from unittest.mock import MagicMock -from freqtrade.tests.conftest import get_patched_exchange +from tests.conftest import get_patched_exchange def test_buy_kraken_trading_agreement(default_conf, mocker): diff --git a/tests/optimize/test_backtest_detail.py b/tests/optimize/test_backtest_detail.py index 87f567b4f..8cd88a479 100644 --- a/tests/optimize/test_backtest_detail.py +++ b/tests/optimize/test_backtest_detail.py @@ -8,11 +8,9 @@ from pandas import DataFrame from freqtrade.data.history import get_timeframe from freqtrade.optimize.backtesting import Backtesting from freqtrade.strategy.interface import SellType -from freqtrade.tests.conftest import patch_exchange -from freqtrade.tests.optimize import (BTContainer, BTrade, - _build_backtest_dataframe, - _get_frame_time_from_offset, - tests_ticker_interval) +from tests.conftest import patch_exchange +from tests.optimize import (BTContainer, BTrade, _build_backtest_dataframe, + _get_frame_time_from_offset, tests_ticker_interval) # Test 0: Sell with signal sell in candle 3 # Test with Stop-loss at 1% diff --git a/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py index b1b6dfa06..34c0322cb 100644 --- a/tests/optimize/test_backtesting.py +++ b/tests/optimize/test_backtesting.py @@ -22,9 +22,8 @@ from freqtrade.optimize.backtesting import Backtesting from freqtrade.state import RunMode from freqtrade.strategy.default_strategy import DefaultStrategy from freqtrade.strategy.interface import SellType -from freqtrade.tests.conftest import (get_args, log_has, log_has_re, - patch_exchange, - patched_configuration_load_config_file) +from tests.conftest import (get_args, log_has, log_has_re, patch_exchange, + patched_configuration_load_config_file) def trim_dictlist(dict_list, num): @@ -807,7 +806,7 @@ def test_backtest_record(default_conf, fee, mocker): assert dur > 0 -def test_backtest_start_timerange(default_conf, mocker, caplog): +def test_backtest_start_timerange(default_conf, mocker, caplog, testdatadir): default_conf['exchange']['pair_whitelist'] = ['UNITTEST/BTC'] async def load_pairs(pair, timeframe, since): @@ -824,7 +823,7 @@ def test_backtest_start_timerange(default_conf, mocker, caplog): args = [ '--config', 'config.json', '--strategy', 'DefaultStrategy', - '--datadir', 'freqtrade/tests/testdata', + '--datadir', str(testdatadir), 'backtesting', '--ticker-interval', '1m', '--timerange', '-100', @@ -838,7 +837,7 @@ def test_backtest_start_timerange(default_conf, mocker, caplog): 'Parameter -i/--ticker-interval detected ... Using ticker_interval: 1m ...', 'Ignoring max_open_trades (--disable-max-market-positions was used) ...', 'Parameter --timerange detected: -100 ...', - 'Using data directory: freqtrade/tests/testdata ...', + f'Using data directory: {testdatadir} ...', 'Using stake_currency: BTC ...', 'Using stake_amount: 0.001 ...', 'Backtesting with data from 2017-11-14T21:17:00+00:00 ' @@ -850,7 +849,7 @@ def test_backtest_start_timerange(default_conf, mocker, caplog): assert log_has(line, caplog) -def test_backtest_start_multi_strat(default_conf, mocker, caplog): +def test_backtest_start_multi_strat(default_conf, mocker, caplog, testdatadir): default_conf['exchange']['pair_whitelist'] = ['UNITTEST/BTC'] async def load_pairs(pair, timeframe, since): @@ -870,7 +869,7 @@ def test_backtest_start_multi_strat(default_conf, mocker, caplog): args = [ '--config', 'config.json', - '--datadir', 'freqtrade/tests/testdata', + '--datadir', str(testdatadir), 'backtesting', '--ticker-interval', '1m', '--timerange', '-100', @@ -892,7 +891,7 @@ def test_backtest_start_multi_strat(default_conf, mocker, caplog): 'Parameter -i/--ticker-interval detected ... Using ticker_interval: 1m ...', 'Ignoring max_open_trades (--disable-max-market-positions was used) ...', 'Parameter --timerange detected: -100 ...', - 'Using data directory: freqtrade/tests/testdata ...', + f'Using data directory: {testdatadir} ...', 'Using stake_currency: BTC ...', 'Using stake_amount: 0.001 ...', 'Backtesting with data from 2017-11-14T21:17:00+00:00 ' diff --git a/tests/optimize/test_edge_cli.py b/tests/optimize/test_edge_cli.py index 25ad48e43..f312bba2c 100644 --- a/tests/optimize/test_edge_cli.py +++ b/tests/optimize/test_edge_cli.py @@ -9,9 +9,8 @@ from freqtrade.edge import PairInfo from freqtrade.optimize import setup_configuration, start_edge from freqtrade.optimize.edge_cli import EdgeCli from freqtrade.state import RunMode -from freqtrade.tests.conftest import (get_args, log_has, log_has_re, - patch_exchange, - patched_configuration_load_config_file) +from tests.conftest import (get_args, log_has, log_has_re, patch_exchange, + patched_configuration_load_config_file) def test_setup_configuration_without_arguments(mocker, default_conf, caplog) -> None: diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index a6f0e47e7..eec9e7c19 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -1,13 +1,13 @@ # pragma pylint: disable=missing-docstring,W0212,C0103 import os from datetime import datetime +from pathlib import Path from unittest.mock import MagicMock, PropertyMock import pandas as pd import pytest from arrow import Arrow from filelock import Timeout -from pathlib import Path from freqtrade import OperationalException from freqtrade.data.converter import parse_ticker_dataframe @@ -16,12 +16,12 @@ from freqtrade.optimize import setup_configuration, start_hyperopt from freqtrade.optimize.default_hyperopt import DefaultHyperOpts from freqtrade.optimize.default_hyperopt_loss import DefaultHyperOptLoss from freqtrade.optimize.hyperopt import Hyperopt -from freqtrade.resolvers.hyperopt_resolver import HyperOptResolver, HyperOptLossResolver +from freqtrade.resolvers.hyperopt_resolver import (HyperOptLossResolver, + HyperOptResolver) from freqtrade.state import RunMode from freqtrade.strategy.interface import SellType -from freqtrade.tests.conftest import (get_args, log_has, log_has_re, - patch_exchange, - patched_configuration_load_config_file) +from tests.conftest import (get_args, log_has, log_has_re, patch_exchange, + patched_configuration_load_config_file) @pytest.fixture(scope='function') @@ -47,14 +47,14 @@ def hyperopt_results(): # Functions for recurrent object patching -def create_trials(mocker, hyperopt) -> None: +def create_trials(mocker, hyperopt, testdatadir) -> None: """ When creating trials, mock the hyperopt Trials so that *by default* - we don't create any pickle'd files in the filesystem - we might have a pickle'd file so make sure that we return false when looking for it """ - hyperopt.trials_file = Path('freqtrade/tests/optimize/ut_trials.pickle') + hyperopt.trials_file = testdatadir / '/optimize/ut_trials.pickle' mocker.patch.object(Path, "is_file", MagicMock(return_value=False)) stat_mock = MagicMock() diff --git a/tests/pairlist/test_pairlist.py b/tests/pairlist/test_pairlist.py index e7439bb51..411ae60a3 100644 --- a/tests/pairlist/test_pairlist.py +++ b/tests/pairlist/test_pairlist.py @@ -5,7 +5,7 @@ from unittest.mock import MagicMock, PropertyMock from freqtrade import OperationalException from freqtrade.constants import AVAILABLE_PAIRLISTS from freqtrade.resolvers import PairListResolver -from freqtrade.tests.conftest import get_patched_freqtradebot +from tests.conftest import get_patched_freqtradebot import pytest # whitelist, blacklist diff --git a/tests/rpc/test_fiat_convert.py b/tests/rpc/test_fiat_convert.py index 1689ecac6..8f6b2eb93 100644 --- a/tests/rpc/test_fiat_convert.py +++ b/tests/rpc/test_fiat_convert.py @@ -8,7 +8,7 @@ import pytest from requests.exceptions import RequestException from freqtrade.rpc.fiat_convert import CryptoFiat, CryptoToFiatConverter -from freqtrade.tests.conftest import log_has +from tests.conftest import log_has def test_pair_convertion_object(): diff --git a/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py index 47ed34a58..ff5869009 100644 --- a/tests/rpc/test_rpc.py +++ b/tests/rpc/test_rpc.py @@ -14,7 +14,7 @@ from freqtrade.persistence import Trade from freqtrade.rpc import RPC, RPCException from freqtrade.rpc.fiat_convert import CryptoToFiatConverter from freqtrade.state import State -from freqtrade.tests.conftest import patch_exchange, patch_get_signal +from tests.conftest import patch_exchange, patch_get_signal # Functions for recurrent object patching diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index bcbbb228f..b572a0514 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -13,9 +13,7 @@ from freqtrade.__init__ import __version__ from freqtrade.persistence import Trade from freqtrade.rpc.api_server import BASE_URI, ApiServer from freqtrade.state import State -from freqtrade.tests.conftest import (get_patched_freqtradebot, log_has, - patch_get_signal) - +from tests.conftest import get_patched_freqtradebot, log_has, patch_get_signal _TEST_USER = "FreqTrader" _TEST_PASS = "SuperSecurePassword1!" diff --git a/tests/rpc/test_rpc_manager.py b/tests/rpc/test_rpc_manager.py index d34d76524..7278f0671 100644 --- a/tests/rpc/test_rpc_manager.py +++ b/tests/rpc/test_rpc_manager.py @@ -4,7 +4,7 @@ import logging from unittest.mock import MagicMock from freqtrade.rpc import RPCMessageType, RPCManager -from freqtrade.tests.conftest import log_has, get_patched_freqtradebot +from tests.conftest import log_has, get_patched_freqtradebot def test__init__(mocker, default_conf) -> None: diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index 3930b110d..cf741a7ea 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -21,8 +21,8 @@ from freqtrade.rpc import RPCMessageType from freqtrade.rpc.telegram import Telegram, authorized_only from freqtrade.state import State from freqtrade.strategy.interface import SellType -from freqtrade.tests.conftest import (get_patched_freqtradebot, log_has, - patch_exchange, patch_get_signal) +from tests.conftest import (get_patched_freqtradebot, log_has, patch_exchange, + patch_get_signal) class DummyCls(Telegram): diff --git a/tests/rpc/test_rpc_webhook.py b/tests/rpc/test_rpc_webhook.py index 1c6c07e16..dbbc4cefb 100644 --- a/tests/rpc/test_rpc_webhook.py +++ b/tests/rpc/test_rpc_webhook.py @@ -8,7 +8,7 @@ from requests import RequestException from freqtrade.rpc import RPCMessageType from freqtrade.rpc.webhook import Webhook from freqtrade.strategy.interface import SellType -from freqtrade.tests.conftest import get_patched_freqtradebot, log_has +from tests.conftest import get_patched_freqtradebot, log_has def get_webhook_dict() -> dict: diff --git a/tests/strategy/test_default_strategy.py b/tests/strategy/test_default_strategy.py index 74c81882a..17d6b8ee0 100644 --- a/tests/strategy/test_default_strategy.py +++ b/tests/strategy/test_default_strategy.py @@ -1,19 +1,8 @@ -import json - -import pytest from pandas import DataFrame -from freqtrade.data.converter import parse_ticker_dataframe from freqtrade.strategy.default_strategy import DefaultStrategy -@pytest.fixture -def result(): - with open('freqtrade/tests/testdata/ETH_BTC-1m.json') as data_file: - return parse_ticker_dataframe(json.load(data_file), '1m', pair="UNITTEST/BTC", - fill_missing=True) - - def test_default_strategy_structure(): assert hasattr(DefaultStrategy, 'minimal_roi') assert hasattr(DefaultStrategy, 'stoploss') diff --git a/tests/strategy/test_interface.py b/tests/strategy/test_interface.py index 1bd571870..094cd41a1 100644 --- a/tests/strategy/test_interface.py +++ b/tests/strategy/test_interface.py @@ -10,7 +10,7 @@ from freqtrade.configuration import TimeRange from freqtrade.data.converter import parse_ticker_dataframe from freqtrade.data.history import load_tickerdata_file from freqtrade.persistence import Trade -from freqtrade.tests.conftest import get_patched_exchange, log_has +from tests.conftest import get_patched_exchange, log_has from freqtrade.strategy.default_strategy import DefaultStrategy # Avoid to reinit the same object again and again diff --git a/tests/strategy/test_strategy.py b/tests/strategy/test_strategy.py index 24ec830a0..6992d1aa5 100644 --- a/tests/strategy/test_strategy.py +++ b/tests/strategy/test_strategy.py @@ -12,12 +12,12 @@ from pandas import DataFrame from freqtrade import OperationalException from freqtrade.resolvers import StrategyResolver from freqtrade.strategy.interface import IStrategy -from freqtrade.tests.conftest import log_has, log_has_re +from tests.conftest import log_has, log_has_re def test_search_strategy(): default_config = {} - default_location = Path(__file__).parent.parent.parent.joinpath('strategy').resolve() + default_location = Path(__file__).parent.parent.joinpath('strategy').resolve() s, _ = StrategyResolver._search_object( directory=default_location, diff --git a/tests/test_configuration.py b/tests/test_configuration.py index faf0e4c5f..e6532cecc 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -10,7 +10,8 @@ import pytest from jsonschema import Draft4Validator, ValidationError, validate from freqtrade import OperationalException, constants -from freqtrade.configuration import Arguments, Configuration, validate_config_consistency +from freqtrade.configuration import (Arguments, Configuration, + validate_config_consistency) from freqtrade.configuration.check_exchange import check_exchange from freqtrade.configuration.config_validation import validate_config_schema from freqtrade.configuration.directory_operations import (create_datadir, @@ -19,8 +20,8 @@ from freqtrade.configuration.load_config import load_config_file from freqtrade.constants import DEFAULT_DB_DRYRUN_URL, DEFAULT_DB_PROD_URL from freqtrade.loggers import _set_loggers from freqtrade.state import RunMode -from freqtrade.tests.conftest import (log_has, log_has_re, - patched_configuration_load_config_file) +from tests.conftest import (log_has, log_has_re, + patched_configuration_load_config_file) @pytest.fixture(scope="function") diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 83b1d3107..4ffa863e6 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -16,13 +16,12 @@ from freqtrade.data.dataprovider import DataProvider from freqtrade.freqtradebot import FreqtradeBot from freqtrade.persistence import Trade from freqtrade.rpc import RPCMessageType -from freqtrade.state import State, RunMode +from freqtrade.state import RunMode, State from freqtrade.strategy.interface import SellCheckTuple, SellType -from freqtrade.tests.conftest import (get_patched_freqtradebot, - get_patched_worker, log_has, log_has_re, - patch_edge, patch_exchange, - patch_get_signal, patch_wallet) from freqtrade.worker import Worker +from tests.conftest import (get_patched_freqtradebot, get_patched_worker, + log_has, log_has_re, patch_edge, patch_exchange, + patch_get_signal, patch_wallet) def patch_RPCManager(mocker) -> MagicMock: diff --git a/tests/test_main.py b/tests/test_main.py index a0fd8218b..d6fafe09b 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -10,7 +10,7 @@ from freqtrade.configuration import Arguments from freqtrade.freqtradebot import FreqtradeBot from freqtrade.main import main from freqtrade.state import State -from freqtrade.tests.conftest import (log_has, patch_exchange, +from tests.conftest import (log_has, patch_exchange, patched_configuration_load_config_file) from freqtrade.worker import Worker diff --git a/tests/test_persistence.py b/tests/test_persistence.py index c3ab7c128..85c244f7a 100644 --- a/tests/test_persistence.py +++ b/tests/test_persistence.py @@ -8,7 +8,7 @@ from sqlalchemy import create_engine from freqtrade import OperationalException, constants from freqtrade.persistence import Trade, clean_dry_run_db, init -from freqtrade.tests.conftest import log_has +from tests.conftest import log_has def create_mock_trades(fee): diff --git a/tests/test_plotting.py b/tests/test_plotting.py index a4abda98b..465e3462d 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -19,7 +19,7 @@ from freqtrade.plot.plotting import (add_indicators, add_profit, generate_profit_graph, init_plotscript, plot_profit, plot_trades, store_plot_file) from freqtrade.strategy.default_strategy import DefaultStrategy -from freqtrade.tests.conftest import get_args, log_has, log_has_re +from tests.conftest import get_args, log_has, log_has_re def fig_generating_mock(fig, *args, **kwargs): diff --git a/tests/test_utils.py b/tests/test_utils.py index 9e09fd298..386efb5ec 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -4,7 +4,7 @@ from unittest.mock import MagicMock, PropertyMock import pytest from freqtrade.state import RunMode -from freqtrade.tests.conftest import get_args, log_has, patch_exchange +from tests.conftest import get_args, log_has, patch_exchange from freqtrade.utils import (setup_utils_configuration, start_create_userdir, start_download_data, start_list_exchanges) diff --git a/tests/test_wallets.py b/tests/test_wallets.py index 2c493cfc3..ae2810a2d 100644 --- a/tests/test_wallets.py +++ b/tests/test_wallets.py @@ -1,5 +1,5 @@ # pragma pylint: disable=missing-docstring -from freqtrade.tests.conftest import get_patched_freqtradebot +from tests.conftest import get_patched_freqtradebot from unittest.mock import MagicMock From f2cbc5fb8ffb3847df0bfbaa9b0e101c06ab9a0e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 09:55:02 +0200 Subject: [PATCH 3/7] Fix documentation references to tests folder --- CONTRIBUTING.md | 6 +++--- docs/developer.md | 2 +- docs/plotting.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e15059f56..aac25a423 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,19 +28,19 @@ make it pass. It means you have introduced a regression. #### Test the whole project ```bash -pytest freqtrade +pytest ``` #### Test only one file ```bash -pytest freqtrade/tests/test_.py +pytest tests/test_.py ``` #### Test only one method from one file ```bash -pytest freqtrade/tests/test_.py::test_ +pytest tests/test_.py::test_ ``` ### 2. Test if your code is PEP8 compliant diff --git a/docs/developer.md b/docs/developer.md index 259bfafd8..b048cf93f 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -30,7 +30,7 @@ These are available from `conftest.py` and can be imported in any test module. A sample check looks as follows: ``` python -from freqtrade.tests.conftest import log_has, log_has_re +from tests.conftest import log_has, log_has_re def test_method_to_test(caplog): method_to_test() diff --git a/docs/plotting.md b/docs/plotting.md index 61bf7b74a..4deb6db12 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -179,5 +179,5 @@ freqtrade plot-profit -p LTC/BTC --db-url sqlite:///tradesv3.sqlite --trade-sou ``` ``` bash -freqtrade plot-profit --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p LTC/BTC +freqtrade plot-profit --datadir user_data/data/binance_save/ -p LTC/BTC ``` From 9513115ce0aa671e5a021b1b81f1be8a9b2381ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 10:07:09 +0200 Subject: [PATCH 4/7] Fix paths in tests --- tests/data/test_history.py | 2 +- tests/optimize/test_hyperopt.py | 19 +++++++++---------- tests/test_configuration.py | 2 +- tests/test_main.py | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 857967f39..e747794e5 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -160,7 +160,7 @@ def test_load_data_live_noexchange(default_conf, mocker, caplog, testdatadir) -> def test_testdata_path(testdatadir) -> None: - assert str(Path('freqtrade') / 'tests' / 'testdata') in str(testdatadir) + assert str(Path('tests') / 'testdata') in str(testdatadir) def test_load_cached_data_for_updating(mocker) -> None: diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index eec9e7c19..900405f03 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -1,5 +1,4 @@ # pragma pylint: disable=missing-docstring,W0212,C0103 -import os from datetime import datetime from pathlib import Path from unittest.mock import MagicMock, PropertyMock @@ -54,7 +53,7 @@ def create_trials(mocker, hyperopt, testdatadir) -> None: - we might have a pickle'd file so make sure that we return false when looking for it """ - hyperopt.trials_file = testdatadir / '/optimize/ut_trials.pickle' + hyperopt.trials_file = testdatadir / 'optimize/ut_trials.pickle' mocker.patch.object(Path, "is_file", MagicMock(return_value=False)) stat_mock = MagicMock() @@ -356,23 +355,23 @@ def test_no_log_if_loss_does_not_improve(hyperopt, caplog) -> None: assert caplog.record_tuples == [] -def test_save_trials_saves_trials(mocker, hyperopt, caplog) -> None: - trials = create_trials(mocker, hyperopt) +def test_save_trials_saves_trials(mocker, hyperopt, testdatadir, caplog) -> None: + trials = create_trials(mocker, hyperopt, testdatadir) mock_dump = mocker.patch('freqtrade.optimize.hyperopt.dump', return_value=None) hyperopt.trials = trials hyperopt.save_trials() - trials_file = os.path.join('freqtrade', 'tests', 'optimize', 'ut_trials.pickle') - assert log_has("Saving 1 evaluations to '{}'".format(trials_file), caplog) + trials_file = testdatadir / 'optimize' / 'ut_trials.pickle' + assert log_has(f"Saving 1 evaluations to '{trials_file}'", caplog) mock_dump.assert_called_once() -def test_read_trials_returns_trials_file(mocker, hyperopt, caplog) -> None: - trials = create_trials(mocker, hyperopt) +def test_read_trials_returns_trials_file(mocker, hyperopt, testdatadir, caplog) -> None: + trials = create_trials(mocker, hyperopt, testdatadir) mock_load = mocker.patch('freqtrade.optimize.hyperopt.load', return_value=trials) hyperopt_trial = hyperopt.read_trials() - trials_file = os.path.join('freqtrade', 'tests', 'optimize', 'ut_trials.pickle') - assert log_has("Reading Trials from '{}'".format(trials_file), caplog) + trials_file = testdatadir / 'optimize' / 'ut_trials.pickle' + assert log_has(f"Reading Trials from '{trials_file}'", caplog) assert hyperopt_trial == trials mock_load.assert_called_once() diff --git a/tests/test_configuration.py b/tests/test_configuration.py index e6532cecc..20ebda440 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -26,7 +26,7 @@ from tests.conftest import (log_has, log_has_re, @pytest.fixture(scope="function") def all_conf(): - config_file = Path(__file__).parents[2] / "config_full.json.example" + config_file = Path(__file__).parents[1] / "config_full.json.example" print(config_file) conf = load_config_file(str(config_file)) return conf diff --git a/tests/test_main.py b/tests/test_main.py index d6fafe09b..eec81ee18 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -10,9 +10,9 @@ from freqtrade.configuration import Arguments from freqtrade.freqtradebot import FreqtradeBot from freqtrade.main import main from freqtrade.state import State -from tests.conftest import (log_has, patch_exchange, - patched_configuration_load_config_file) from freqtrade.worker import Worker +from tests.conftest import (log_has, patch_exchange, + patched_configuration_load_config_file) def test_parse_args_backtesting(mocker) -> None: From 9d2c6c8de27b6ea2b0a8740c52b7c9ee2e434778 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 10:17:44 +0200 Subject: [PATCH 5/7] Fix paths in setup and travis --- .coveragerc | 2 +- .travis.yml | 8 ++++---- MANIFEST.in | 1 - setup.cfg | 7 ++++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.coveragerc b/.coveragerc index 4bd5b63fa..96ad6b09b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] omit = scripts/* - freqtrade/tests/* freqtrade/vendor/* freqtrade/__main__.py + tests/* diff --git a/.travis.yml b/.travis.yml index c75049276..405228ab8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,19 +22,19 @@ jobs: include: - stage: tests script: - - pytest --random-order --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/ + - pytest --random-order --cov=freqtrade --cov-config=.coveragerc # Allow failure for coveralls - coveralls || true name: pytest - script: - cp config.json.example config.json - - freqtrade --datadir freqtrade/tests/testdata backtesting + - freqtrade --datadir tests/testdata backtesting name: backtest - script: - cp config.json.example config.json - - freqtrade --datadir freqtrade/tests/testdata hyperopt -e 5 + - freqtrade --datadir tests/testdata hyperopt -e 5 name: hyperopt - - script: flake8 freqtrade scripts + - script: flake8 name: flake8 - script: # Test Documentation boxes - diff --git a/MANIFEST.in b/MANIFEST.in index 63508c05d..7529152a0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,3 @@ include LICENSE include README.md include config.json.example recursive-include freqtrade *.py -include freqtrade/tests/testdata/*.json diff --git a/setup.cfg b/setup.cfg index 473f50639..34f25482b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,9 +2,14 @@ #ignore = max-line-length = 100 max-complexity = 12 +exclude = + .git, + __pycache__, + .eggs, + user_data, [mypy] ignore_missing_imports = True -[mypy-freqtrade.tests.*] +[mypy-tests.*] ignore_errors = True From 0bb1127cb6dcdb3142a22029bc3048f569add92c Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 10:19:00 +0200 Subject: [PATCH 6/7] update .gitignore things we no longer use should not be excluded --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1664ad7eb..e0b7a7b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ # Freqtrade rules -freqtrade/tests/testdata/*.json -hyperopt_conf.py config*.json *.sqlite -.hyperopt logfile.txt -hyperopt_trials.pickle user_data/* !user_data/notebooks user_data/notebooks/* From 3e0edc7ee2b88bcab7234fb261a61c67f93fb79f Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Sep 2019 10:28:55 +0200 Subject: [PATCH 7/7] Update backtesting section about correct data used --- docs/backtesting.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/backtesting.md b/docs/backtesting.md index 3da76c0ce..45d5f486f 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -43,12 +43,11 @@ Now you have good Buy and Sell strategies and some historic data, you want to te real data. This is what we call [backtesting](https://en.wikipedia.org/wiki/Backtesting). -Backtesting will use the crypto-currencies (pair) from your config file -and load static tickers located in -[/freqtrade/tests/testdata](https://github.com/freqtrade/freqtrade/tree/develop/freqtrade/tests/testdata). -If the 5 min and 1 min ticker for the crypto-currencies to test is not -already in the `testdata` directory, backtesting will download them -automatically. Testdata files will not be updated until you specify it. +Backtesting will use the crypto-currencies (pairs) from your config file +and load ticker data from `user_data/data/` by default. +If no data is available for the exchange / pair / ticker interval combination, backtesting will +ask you to download them first using `freqtrade download-data`. +For details on downloading, please refer to the [relevant section](#Getting-data-for-backtesting-and-hyperopt) in the documentation. The result of backtesting will confirm you if your bot has better odds of making a profit than a loss.