Skip to content

Commit

Permalink
changing form % strings to .format()
Browse files Browse the repository at this point in the history
  • Loading branch information
brianray committed May 21, 2015
1 parent 343b571 commit 2f2374d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,20 @@ def check_summary_score(use_feature_hashing=False):

# We itereate over each model with an expected
# accuracy score. T est proves that the report
# written out at least as a correct format for
# written out at least as a correct format for
# this line. See _print_fancy_output
for report_name, val in (("LogisticRegression", .5),
("MultinomialNB", .5),
("SVC", .7)):
filename = "test_summary_test_summary_%s.results" % report_name
filename = "test_summary_test_summary_{}.results".format(report_name)
test_path = join(_my_dir, 'output', filename)
with open(test_path) as f:
report = f.read()
expected_string = "Accuracy = %.1f" % val
expected_string = "Accuracy = {:.1f}".format(val)
eq_(expected_string in report, # approximate
True,
msg="%s is not in %s" % (expected_string,
report))
msg="{} is not in {}".format(expected_string,
report))


def test_summary():
Expand Down

0 comments on commit 2f2374d

Please sign in to comment.