Repository: quantopian/zipline
File: zipline/testing/fixtures.py (Python)

Code before:
    def make_adjustment_writer(cls, conn):
        return SQLiteAdjustmentWriter(
            conn,
            cls.make_adjustment_writer_equity_daily_bar_reader(),
        )

    @classmethod
    def make_adjustment_writer_equity_daily_bar_reader(cls):
        return cls.bcolz_equity_daily_bar_reader

    @classmethod
    def make_adjustment_db_conn_str(cls):
        return ':memory:'

    @classmethod
    def init_class_fixtures(cls):
        super(WithAdjustmentReader, cls).init_class_fixtures()
        conn = sqlite3.connect(cls.make_adjustment_db_conn_str())
        cls.make_adjustment_writer(conn).write(
            splits=cls.make_splits_data(),
            mergers=cls.make_mergers_data(),
            dividends=cls.make_dividends_data(),
            stock_dividends=cls.make_stock_dividends_data(),
        )
        cls.adjustment_reader = SQLiteAdjustmentReader(conn)


class WithUSEquityPricingPipelineEngine(WithAdjustmentReader,
                                        WithTradingSessions):
    """
    Mixin providing the following as a class-level fixtures.
        - cls.data_root_dir
        - cls.findata_dir
        - cls.pipeline_engine
        - cls.adjustments_db_path

    """

    @classmethod
    def init_class_fixtures(cls):
        cls.data_root_dir = cls.enter_class_context(tmp_dir())
        cls.findata_dir = cls.data_root_dir.makedir('findata')
        super(WithUSEquityPricingPipelineEngine, cls).init_class_fixtures()

        loader = USEquityPricingLoader.without_fx(
            cls.bcolz_equity_daily_bar_reader,
            SQLiteAdjustmentReader(cls.adjustments_db_path),
        )

        def get_loader(column):
            if column in USEquityPricing.columns:

Review comment (suggestion):
Looks like this is from using [system-dependent `np.integer`](https://github.com/quantopian/zipline/blob/e63871f7e5affb0431a9d4d3780f14d15a315aba/zipline/data/adjustments.py#L50) instead of `int64` or `int32`. My initial thought is we should be stricter, since we control the data format. I say we leave what you have here and open an issue.

Code after:
    make_stock_dividends_data = _make_data

    del _make_data

    @classmethod
    def make_adjustment_writer(cls, conn):
        return SQLiteAdjustmentWriter(
            conn,
            cls.make_adjustment_writer_equity_daily_bar_reader(),
        )

    @classmethod
    def make_adjustment_writer_equity_daily_bar_reader(cls):
        return cls.bcolz_equity_daily_bar_reader

    @classmethod
    def make_adjustment_db_conn_str(cls):
        return ':memory:'

    @classmethod
    def init_class_fixtures(cls):
        super(WithAdjustmentReader, cls).init_class_fixtures()
        conn = sqlite3.connect(cls.make_adjustment_db_conn_str())
        # Silence numpy DeprecationWarnings which cause nosetest to fail
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)

            cls.make_adjustment_writer(conn).write(
                splits=cls.make_splits_data(),
                mergers=cls.make_mergers_data(),
                dividends=cls.make_dividends_data(),
                stock_dividends=cls.make_stock_dividends_data(),
            )
        cls.adjustment_reader = SQLiteAdjustmentReader(conn)


class WithUSEquityPricingPipelineEngine(WithAdjustmentReader,
                                        WithTradingSessions):
    """
    Mixin providing the following as a class-level fixtures.
        - cls.data_root_dir
        - cls.findata_dir
        - cls.pipeline_engine
        - cls.adjustments_db_path

    """

    @classmethod
    def init_class_fixtures(cls):
        cls.data_root_dir = cls.enter_class_context(tmp_dir())
        cls.findata_dir = cls.data_root_dir.makedir('findata')