mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-09 11:50:09 +08:00
TST: Clean up metaclass usage in fixtures
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from abc import abstractmethod
|
||||
|
||||
import numpy as np
|
||||
from operator import itemgetter
|
||||
import pandas as pd
|
||||
from six import with_metaclass
|
||||
import talib
|
||||
from toolz import compose, excepts
|
||||
|
||||
@@ -19,10 +18,7 @@ from zipline.testing.fixtures import WithAssetFinder, ZiplineTestCase
|
||||
from zipline.testing.predicates import assert_equal
|
||||
|
||||
|
||||
_meta = type('_', (type(ZiplineTestCase), ABCMeta), {})
|
||||
|
||||
|
||||
class WithTechnicalFactor(with_metaclass(_meta, WithAssetFinder)):
|
||||
class WithTechnicalFactor(WithAssetFinder):
|
||||
"""ZiplineTestCase fixture for testing technical factors.
|
||||
"""
|
||||
ASSET_FINDER_EQUITY_SIDS = tuple(range(5))
|
||||
|
||||
@@ -12,7 +12,6 @@ import numpy as np
|
||||
import pandas as pd
|
||||
import responses
|
||||
|
||||
|
||||
from .core import (
|
||||
create_daily_bar_data,
|
||||
create_minute_bar_data,
|
||||
@@ -37,7 +36,7 @@ from ..finance.trading import TradingEnvironment
|
||||
from ..utils import tradingcalendar, factory
|
||||
from ..utils.classproperty import classproperty
|
||||
from ..utils.final import FinalMeta, final
|
||||
from ..utils.metautils import compose_types
|
||||
from ..utils.metautils import with_metaclasses
|
||||
from .core import tmp_asset_finder, make_simple_equity_info, gen_calendars
|
||||
from zipline.pipeline import Pipeline, SimplePipelineEngine
|
||||
from zipline.pipeline.loaders.testing import make_seeded_random_loader
|
||||
@@ -818,8 +817,8 @@ class WithAdjustmentReader(WithBcolzDailyBarReader):
|
||||
cls.adjustment_reader = SQLiteAdjustmentReader(conn)
|
||||
|
||||
|
||||
class WithPipelineEventDataLoader(with_metaclass(
|
||||
compose_types(ABCMeta, type(ZiplineTestCase)), WithAssetFinder)):
|
||||
class WithPipelineEventDataLoader(
|
||||
with_metaclasses((type(ZiplineTestCase), ABCMeta), WithAssetFinder)):
|
||||
"""
|
||||
ZiplineTestCase mixin providing common test methods/behaviors for event
|
||||
data loaders.
|
||||
|
||||
Reference in New Issue
Block a user