mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-08 18:38:53 +08:00
Merge pull request #83 from quantopian/new_world_order
removed bson dep
This commit is contained in:
@@ -4,7 +4,6 @@ import time
|
||||
import zipline.protocol as zp
|
||||
from datetime import datetime
|
||||
import blist
|
||||
from bson import ObjectId
|
||||
from zipline.utils.date_utils import EPOCH
|
||||
from itertools import izip
|
||||
from logbook import FileHandler
|
||||
@@ -62,14 +61,6 @@ def check(test, a, b, label=None):
|
||||
else:
|
||||
test.assertEqual(a, b, "mismatch on path: " + label)
|
||||
|
||||
def check_excluded(test, a, excluded_keys=[]):
|
||||
for key, value in a.iteritems():
|
||||
test.assertTrue(key not in excluded_keys)
|
||||
test.assertFalse(key.endswith('_id'), 'Avoid _id fields!')
|
||||
test.assertFalse(isinstance(value, ObjectId))
|
||||
if isinstance(value, dict):
|
||||
check_excluded(test, value, excluded_keys)
|
||||
|
||||
def drain_zipline(test, zipline, p_blocking=False):
|
||||
assert test.ctx, "method expects a valid zmq context"
|
||||
assert test.zipline_test_config, "method expects a valid test config"
|
||||
@@ -179,26 +170,26 @@ def create_monitor(allocator):
|
||||
return mon
|
||||
|
||||
class ExceptionSource(object):
|
||||
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get_hash(self):
|
||||
return "ExceptionSource"
|
||||
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
5 / 0
|
||||
|
||||
|
||||
class ExceptionTransform(object):
|
||||
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get_hash(self):
|
||||
return "ExceptionTransform"
|
||||
|
||||
|
||||
def update(self, event):
|
||||
assert False, "An assertion message"
|
||||
|
||||
Reference in New Issue
Block a user