mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-12 12:12:04 +08:00
Upgrades flake8 from 1.5 -> 1.6
Also, removes flake8 ignores, since the warnings that were at odds with eachother now work.
This commit is contained in:
@@ -31,9 +31,9 @@ from zipline.finance.performance import PerformanceTracker
|
||||
from zipline.utils.protocol_utils import ndict
|
||||
from zipline.finance.trading import TransactionSimulator
|
||||
from zipline.utils.test_utils import(
|
||||
setup_logger,
|
||||
teardown_logger,
|
||||
assert_single_position
|
||||
setup_logger,
|
||||
teardown_logger,
|
||||
assert_single_position
|
||||
)
|
||||
|
||||
DEFAULT_TIMEOUT = 15 # seconds
|
||||
|
||||
@@ -126,8 +126,8 @@ check treasury and benchmark data in findb, and re-run the test."""
|
||||
trades[-1]['price'],
|
||||
"last sale should be same as last trade. \
|
||||
expected {exp} actual {act}".format(
|
||||
exp=trades[-1]['price'],
|
||||
act=pp.positions[1].last_sale_price)
|
||||
exp=trades[-1]['price'],
|
||||
act=pp.positions[1].last_sale_price)
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
@@ -565,7 +565,7 @@ shares in position"
|
||||
'price',
|
||||
'changed']
|
||||
perf_tracker = perf.PerformanceTracker(
|
||||
self.trading_environment
|
||||
self.trading_environment
|
||||
)
|
||||
|
||||
for event in trade_history:
|
||||
|
||||
+5
-6
@@ -763,12 +763,11 @@ class Risk(unittest.TestCase):
|
||||
"mismatch for total months - \
|
||||
expected:{total_months}/actual:{actual}, \
|
||||
period:{period_length}, start:{start_date}, \
|
||||
calculated end:{end}".format(
|
||||
total_months=total_months,
|
||||
period_length=period_length,
|
||||
start_date=start_date,
|
||||
end=col[-1].end_date,
|
||||
actual=len(col))
|
||||
calculated end:{end}".format(total_months=total_months,
|
||||
period_length=period_length,
|
||||
start_date=start_date,
|
||||
end=col[-1].end_date,
|
||||
actual=len(col))
|
||||
)
|
||||
self.assert_month(start_date.month, col[-1].end_date.month)
|
||||
self.assert_last_day(col[-1].end_date)
|
||||
|
||||
@@ -332,18 +332,18 @@ class TestBatchTransform(TestCase):
|
||||
for test_history in [algo.history_return_price_class,
|
||||
algo.history_return_price_decorator]:
|
||||
np.testing.assert_array_equal(
|
||||
range(2, 8),
|
||||
test_history[2].values.flatten()
|
||||
range(2, 8),
|
||||
test_history[2].values.flatten()
|
||||
)
|
||||
|
||||
np.testing.assert_array_equal(
|
||||
range(2, 8),
|
||||
test_history[3].values.flatten()
|
||||
range(2, 8),
|
||||
test_history[3].values.flatten()
|
||||
)
|
||||
|
||||
np.testing.assert_array_equal(
|
||||
range(4, 12),
|
||||
test_history[4].values.flatten()
|
||||
range(4, 12),
|
||||
test_history[4].values.flatten()
|
||||
)
|
||||
|
||||
def test_passing_of_args(self):
|
||||
|
||||
Reference in New Issue
Block a user