Skip to content

Commit

Permalink
Fix assertions and repr.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Oct 23, 2015
1 parent 74570c5 commit e393ab3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/pytest_benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ def parse_sort(string):
string = string.lower().strip()
if string not in ("min", "max", "mean", "stddev"):
raise argparse.ArgumentTypeError(
"Unacceptable value: %s. "
"Value for --benchmark-sort must be one of: 'min', 'max', 'mean' or 'stddev'. " % string)
"Unacceptable value: %r. "
"Value for --benchmark-sort must be one of: 'min', 'max', 'mean' or 'stddev'." % string)
return string


Expand Down
6 changes: 3 additions & 3 deletions tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def test_bad_compare_fail(testdir):
result = testdir.runpytest('--doctest-modules', '--benchmark-compare-fail=?', test)
result.stderr.fnmatch_lines([
"usage: py* [[]options[]] [[]file_or_dir[]] [[]file_or_dir[]] [[]...[]]",
"py*: error: argument --benchmark-compare-fail: Could not parse value.",
"py*: error: argument --benchmark-compare-fail: Could not parse value: '?'.",
])


Expand Down Expand Up @@ -613,8 +613,8 @@ def test_bogus_sort(testdir):
result = testdir.runpytest('--benchmark-sort=bogus', test)
result.stderr.fnmatch_lines([
"usage: py* [[]options[]] [[]file_or_dir[]] [[]file_or_dir[]] [[]...[]]",
"py*: error: argument --benchmark-sort: Value for --benchmark-sort must be one of: 'min', 'max', "
"'mean' or 'stddev'.",
"py*: error: argument --benchmark-sort: Unacceptable value: 'bogus'. Value for --benchmark-sort must be one of: 'min', 'max', 'mean' or 'stddev'."

])


Expand Down

0 comments on commit e393ab3

Please sign in to comment.