PEP8 linting

This commit is contained in:
gcarq
2017-10-31 00:36:35 +01:00
parent 26468bef83
commit e07904d436
9 changed files with 33 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ from freqtrade.persistence import Trade
logging.disable(logging.DEBUG) # disable debug logs that slow backtesting a lot
def format_results(results):
return 'Made {} buys. Average profit {:.2f}%. Total profit was {:.3f}. Average duration {:.1f} mins.'.format(
len(results.index),
@@ -21,15 +22,18 @@ def format_results(results):
results.duration.mean() * 5
)
def print_pair_results(pair, results):
print('For currency {}:'.format(pair))
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 {
@@ -42,6 +46,7 @@ def conf():
"stoploss": -0.40
}
def backtest(conf, pairs, mocker):
trades = []
mocked_history = mocker.patch('freqtrade.analyze.get_ticker_history')
@@ -66,6 +71,7 @@ def backtest(conf, pairs, mocker):
results = DataFrame.from_records(trades, columns=labels)
return results
@pytest.mark.skipif(not os.environ.get('BACKTEST', False), reason="BACKTEST not set")
def test_backtest(conf, pairs, mocker, report=True):
results = backtest(conf, pairs, mocker)