Skip to content

Commit

Permalink
test_utils.py/warn_or_crash_slow_parser() significant figures
Browse files Browse the repository at this point in the history
It's not OK to print

juriscraper.lib.exceptions.SlownessException: This scraper took 3.372174024581909s to test, which is more than the allowed speed of 1s. Please speed it up for tests to pass.

Limit to three digits of precision to the right of the decimal point (fixed-point).
  • Loading branch information
johnhawkinson committed Oct 13, 2023
1 parent 2d864fc commit da75dab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion juriscraper/lib/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def warn_or_crash_slow_parser(duration, warn_duration=1, max_duration=15):
# Only do this if we're not debugging. Debuggers make things slower
# and breakpoints make things stop.
raise SlownessException(
"This scraper took {duration}s to test, which is more than "
"This scraper took {duration:.3f}s to test, which is more than "
"the allowed speed of {max_duration}s. Please speed it up for "
"tests to pass.".format(
duration=duration, max_duration=max_duration
Expand Down

0 comments on commit da75dab

Please sign in to comment.