put shared fixtures to conftest.py

This commit is contained in:
Janne Sinivirta 2017-11-07 17:18:29 +02:00
parent 3d42b9fd75
commit fbbde9de25
3 changed files with 18 additions and 38 deletions

View File

@ -0,0 +1,18 @@
import pytest
@pytest.fixture(scope="module")
def pairs():
return ['btc-neo', 'btc-eth', 'btc-omg', 'btc-edg', 'btc-pay',
'btc-pivx', 'btc-qtum', 'btc-mtl', 'btc-etc', 'btc-ltc']
@pytest.fixture(scope="module")
def conf():
return {
"minimal_roi": {
"40": 0.0,
"30": 0.01,
"20": 0.02,
"0": 0.04
},
"stoploss": -0.05
}

View File

@ -26,25 +26,6 @@ def print_pair_results(pair, results):
print(format_results(results[results.currency == pair]))
@pytest.fixture
def pairs():
return ['btc-neo', 'btc-eth', 'btc-omg', 'btc-edg', 'btc-pay',
'btc-pivx', 'btc-qtum', 'btc-mtl', 'btc-etc', 'btc-ltc']
@pytest.fixture
def conf():
return {
"minimal_roi": {
"50": 0.0,
"40": 0.01,
"30": 0.02,
"0": 0.045
},
"stoploss": -0.40
}
def backtest(conf, pairs, mocker):
trades = []
exchange._API = Bittrex({'key': '', 'secret': ''})

View File

@ -18,25 +18,6 @@ logging.disable(logging.DEBUG) # disable debug logs that slow backtesting a lot
TARGET_TRADES = 1200
@pytest.fixture
def pairs():
return ['btc-neo', 'btc-eth', 'btc-omg', 'btc-edg', 'btc-pay',
'btc-pivx', 'btc-qtum', 'btc-mtl', 'btc-etc', 'btc-ltc']
@pytest.fixture
def conf():
return {
"minimal_roi": {
"40": 0.0,
"30": 0.01,
"20": 0.02,
"0": 0.04
},
"stoploss": -0.05
}
def buy_strategy_generator(params):
print(params)