'Test adding a CustomFactor instance, which has multiple outputs, as a
pipeline column directly. Its computed values should be tuples
containing the computed values of each of its outputs.'

def test_instance_of_factor_with_multiple_outputs(self):

    dates = self.dates[5:10]
    assets = self.assets
    num_dates = len(dates)
    num_assets = len(assets)
    constants = self.constants
    engine = SimplePipelineEngine((lambda column: self.loader), self.dates, self.asset_finder)
    open_values = ([constants[USEquityPricing.open]] * num_assets)
    close_values = ([constants[USEquityPricing.close]] * num_assets)
    expected_values = ([list(zip(open_values, close_values))] * num_dates)
    expected_results = DataFrame(expected_values, index=dates, columns=assets, dtype=float64)
    multiple_outputs = MultipleOutputs()
    pipeline = Pipeline(columns={'instance': multiple_outputs})
    results = engine.run_pipeline(pipeline, dates[0], dates[(-1)])
    instance_results = results['instance'].unstack()
    assert_frame_equal(instance_results, expected_results)
