Can we customise the "output" field's formatting? #62
-
Hello, I'm sorry if this question has an obvious answer, but I was not able to find an answer in the documentation or via my own debugging over the past few days. I've based my system on this example, the key part is
So this has characters "1", "(space)", "2" and "newline-char" in that order, now if my program has the same output then the test passes and its all good, but my issue is with the fail case outputting. The
Notice how the first newline char is escaped. This means on the gradescope website it actually outputs
The problem is I don't know how and where to override the output string. I think this has nothing to do with the python unit tests/ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The To hide the default message generated by the |
Beta Was this translation helpful? Give feedback.
The
assertIn
function (as well as otherassertX
functions) has amsg
parameter where you can pass in a custom message.To hide the default message generated by the
assertX
functions, you can callself.longMessage = False
prior to calling theassertX
function. I've placed it inside ofsetUp
in my own use.