'Test passing an `outputs` parameter of length 1 to a CustomFactor.'

def test_factor_with_single_output(self):

    dates = self.dates[5:10]
    assets = self.assets
    num_dates = len(dates)
    open = USEquityPricing.open
    open_values = ([self.constants[open]] * num_dates)
    open_values_as_tuple = ([(self.constants[open],)] * num_dates)
    engine = SimplePipelineEngine((lambda column: self.loader), self.dates, self.asset_finder)
    single_output = OpenPrice(outputs=['open'])
    pipeline = Pipeline(columns={'open_instance': single_output, 'open_attribute': single_output.open})
    results = engine.run_pipeline(pipeline, dates[0], dates[(-1)])
    open_instance_expected = {asset: open_values_as_tuple for asset in assets}
    open_attribute_expected = {asset: open_values for asset in assets}
    for (colname, expected_values) in (('open_instance', open_instance_expected), ('open_attribute', open_attribute_expected)):
        column_results = results[colname].unstack()
        expected_results = DataFrame(expected_values, index=dates, columns=assets, dtype=float64)
        assert_frame_equal(column_results, expected_results)
