Skip to content

Commit

Permalink
Merge pull request #2860 from martinholmer/code-coverage
Browse files Browse the repository at this point in the history
Add test to the test_records.py file
  • Loading branch information
martinholmer authored Jan 6, 2025
2 parents 02d84f7 + 7ac5d6c commit 2468193
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion taxcalc/tests/test_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from taxcalc import GrowFactors, Policy, Records


def test_incorrect_records_instantiation(cps_subsample):
def test_incorrect_records_instantiation(cps_subsample, cps_fullsample):
"""Test docstring"""
with pytest.raises(ValueError):
_ = Records(data=[])
Expand All @@ -28,6 +28,11 @@ def test_incorrect_records_instantiation(cps_subsample):
with pytest.raises(ValueError):
_ = Records(data=cps_subsample, gfactors=None, weights=None,
adjust_ratios=[])
# test error raise when num of records is greater than num of weights
wghts_path = os.path.join(Records.CODE_PATH, Records.PUF_WEIGHTS_FILENAME)
puf_wghts = pd.read_csv(wghts_path)
with pytest.raises(ValueError):
_ = Records(data=cps_fullsample, weights=puf_wghts, start_year=2020)


def test_correct_records_instantiation(cps_subsample):
Expand Down

0 comments on commit 2468193

Please sign in to comment.