I noticed that the unittest pipeline was failing. I opened up the logs and saw a wall of text that took about 20 pages to scroll through to see what was failing. It turned out to be an Assert
failure where the input wasn't raising an exception
.
The parametrized test case failure was 1MB byte
array that needed to raise the exception.
Parameterize tests need ids
for each test, which the test case's arguments generate.
Numbers, strings, booleans and None will have their usual string representation used in the test ID. For other objects, pytest will make a string based on the argument name:
Luckily, parametrize
's ids
keyword argument takes an iterable of strings for which you can override this default behavior.
Good bye wall of text!
Reference