I'm writing, in Python, a class that emulates a numeric types. I'd like to have some numerous doctests, as well as to have no pycodestyle warning from pylava.
Here is my difficulty.
For the following doctest
Traceback (most recent call last):
...
TypeError: Only RiemannSphere, integers or floats can be added to a RiemannSphere
I've got a warning from pylava, because my line TypeError: ...is too long.
Is someone knows how to cut it into two lines even if it is in a doctest?
Thanks,
I've just found out a nice solution, using ELLIPSIS:
The initial doctest was:
Using the # doctest: +ELLIPSIS directive, this can be written shortly:
Consequently, it's now easy to change the message in the Traceback so that pylava does not give warning.