Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes on tests #347

Merged
merged 1 commit into from
Sep 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions taxcalc/tests/test_calculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@ def test_make_Calculator_deepcopy():
calc2 = copy.deepcopy(calc)


def test_make_Calculator_from_files(paramsfile):
with open(paramsfile.name) as pfile:
params = json.load(pfile)
ppo = Parameters(parameter_dict=params, start_year=1991,
num_years=len(irates), inflation_rates=irates)
calc = Calculator(params=ppo, records=tax_dta_path,
start_year=1991, inflation_rates=irates)
assert calc


def test_make_Calculator_files_to_ctor(paramsfile):
with open(paramsfile.name) as pfile:
params = json.load(pfile)
Expand Down Expand Up @@ -255,11 +245,10 @@ def test_make_Calculator_user_mods_with_cpi_flags(paramsfile):
assert_array_equal(act_almsep, exp_almsep)


def test_make_Calculator_empty_params_is_default_params():
ppo = Parameters()
def test_make_Calculator_raises_on_no_params():
rec = Records(tax_dta, start_year=2013)
calc = Calculator(params=ppo, records=rec)
assert calc
with pytest.raises(ValueError):
calc = Calculator(records=rec)


def test_Calculator_attr_access_to_params():
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_parameters_get_default():
assert paramdata['_CDCC_ps'] == [15000]


def test_reform_with_no_year():
def test_implement_reform_Parameters_raises_on_no_year():
reform = {"_STD_Aged": [[1400, 1200]]}
ppo = Parameters()
with pytest.raises(ValueError):
Expand All @@ -382,7 +382,7 @@ def test_Parameters_reform_in_start_year():
np.array([1400, 1100, 1100, 1400, 1400, 1199]))


def test_Parameters_reform_before_start_year():
def test_implement_reform_Parameters_raises_on_future_year():
ppo = Parameters(start_year=2013)
with pytest.raises(ValueError):
reform = {2010: {"_STD_Aged": [[1400, 1100, 1100, 1400, 1400, 1199]]}}
Expand Down