def test_1(input_file): """ Test SimpleTaxIO instantiation with no policy reform. """ SimpleTaxIO.show_iovar_definitions() simtax = SimpleTaxIO(input_filename=input_file.name, reform=None, exact_calculations=False, emulate_taxsim_2441_logic=False, output_records=False) assert simtax.number_input_lines() == NUM_INPUT_LINES # test extracting of weight and debugging variables SimpleTaxIO.DVAR_NAMES = ['f2441'] ovar = SimpleTaxIO.extract_output(simtax.calc, 0, exact=True, extract_weight=True) assert ovar SimpleTaxIO.DVAR_NAMES = ['badvar'] with pytest.raises(AttributeError): ovar = SimpleTaxIO.extract_output(simtax.calc, 0) SimpleTaxIO.DVAR_NAMES = []
def test_1(input_file): # pylint: disable=redefined-outer-name """ Test SimpleTaxIO instantiation with no policy reform. """ SimpleTaxIO.show_iovar_definitions() simtax = SimpleTaxIO(input_filename=input_file.name, reform=None, exact_calculations=False, emulate_taxsim_2441_logic=False, output_records=False) assert simtax.number_input_lines() == NUM_INPUT_LINES # test extracting of weight and debugging variables crecs = simtax._calc.records # pylint: disable=protected-access SimpleTaxIO.DVAR_NAMES = ['f2441'] # pylint: disable=unused-variable ovar = SimpleTaxIO.extract_output(crecs, 0, exact=True, extract_weight=True) SimpleTaxIO.DVAR_NAMES = ['badvar'] with pytest.raises(ValueError): ovar = SimpleTaxIO.extract_output(crecs, 0) SimpleTaxIO.DVAR_NAMES = []