Differences between result and expected cluttering the terminal when AssertionError is raised

gabriel.bustamante (2540 points)
3 5 20
asked Dec 9, 2021 in HW8 by gabriel.bustamante (2,540 points)

While testing my program in the early stages I found that the terminal easily filled with the differences between my result and the expected one. These will surely be useful later on, but they can make the tests' outcome more difficult to read; so I googled a way to avoid that and only see what kind of errors the tests raised:

Simply paste this above check_json_file_to_list in testlib.py

longMessage = False
If the list my function returned is wrong:
False means that numbers won't fill the terminal
True will show lots of numbers (very long and annoying!)

longMessage is True by default, setting it to False will show a more concise report of the error(s) with less specific information


Please log in or register to answer this question.