TST: Add logging of sim params for perf tracker tests.

These tests use the random simulation parameters, which is leading
to an intermittent failure.

We may want to consider removing the randomness, but in the meantime
the randomness is exposing a case where the cost basis is not the value
expected, so logging the sim parameter values to help track down what
parameters cause the failure.
This commit is contained in:
Eddie Hebert
2013-10-16 12:07:14 -04:00
parent f8ce7d944b
commit 37e1e74391
+6
View File
@@ -15,6 +15,7 @@
import collections
import heapq
import logging
import operator
import unittest
@@ -37,6 +38,8 @@ from zipline.utils.factory import create_random_simulation_parameters
import zipline.protocol
from zipline.protocol import Event
logger = logging.getLogger('Test Perf Tracking')
onesec = datetime.timedelta(seconds=1)
oneday = datetime.timedelta(days=1)
tradingday = datetime.timedelta(hours=6, minutes=30)
@@ -151,6 +154,9 @@ class TestCommissionEvents(unittest.TestCase):
self.sim_params, self.dt, self.end_dt = \
create_random_simulation_parameters()
logger.info("sim_params: %s, dt: %s, end_dt: %s" %
(self.sim_params, self.dt, self.end_dt))
self.sim_params.capital_base = 10e3
self.benchmark_events = benchmark_events_in_range(self.sim_params)