Skip to content

Commit

Permalink
Fix pylint W1514 and W3301 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 6, 2025
1 parent cc6f9fe commit f286398
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion taxcalc/calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ def F2441(MARS, earned_p, earned_s, f2441, CDCC_c, e32800,
c32890 = earned_s # earned income of spouse when present
else:
c32890 = earned_p
c33000 = max(0., min(c32800, min(c32880, c32890)))
c33000 = max(0., min(c32800, c32880, c32890))
# credit rate is limited at high AGI
# ... first phase-down from CDCC_crt to CDCC_frt
steps_fractional = max(0., c00100 - CDCC_ps) / CDCC_po_step_size
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def fixture_test_reforms(tests_path):
for afile in glob.glob(afiles):
os.remove(afile)
# create reforms_actual_init file
with open(initfile, 'w') as ifile:
with open(initfile, 'w', encoding='utf-8') as ifile:
ifile.write('test_reforms initialization done')
else:
num_waits = 0
Expand All @@ -109,7 +109,7 @@ def fixture_test_reforms(tests_path):
# compare actual and expected results for each test
# ... read expected results
efile_path = os.path.join(tests_path, 'reforms_expect.csv')
with open(efile_path, 'r') as efile:
with open(efile_path, 'r', encoding='utf-8') as efile:
expect_lines = efile.readlines()
# ... compare actual and expected results for each test
diffs = False
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/tests/test_growdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_description_punctuation(tests_path):
"""
# read JSON file into a dictionary
path = os.path.join(tests_path, '..', 'growdiff.json')
with open(path, 'r') as jsonfile:
with open(path, 'r', encoding='utf-8') as jsonfile:
dct = json.load(jsonfile)
all_desc_ok = True
for param in dct.keys():
Expand All @@ -83,7 +83,7 @@ def test_boolean_value_infomation(tests_path):
"""
# read growdiff.json file into a dictionary
path = os.path.join(tests_path, '..', 'growdiff.json')
with open(path, 'r') as gddfile:
with open(path, 'r', encoding='utf-8') as gddfile:
gdd = json.load(gddfile)
for param in gdd.keys():
if param == "schema":
Expand Down

0 comments on commit f286398

Please sign in to comment.