diff --git a/testing/test_assertmessage.py b/testing/test_assertmessage.py new file mode 100644 index 000000000..ca67ff55a --- /dev/null +++ b/testing/test_assertmessage.py @@ -0,0 +1,18 @@ + +def test_assert_message_fail(): + ''' + Check if custom message with % sign do not raise ValueError + Later test can be parametrized with other problematic chars + ''' + + MESSAGE = 'Message with %' + + try: + assert False, MESSAGE + except ValueError, ve: + assert False, 'ValueError was raised with the following message: ' \ + + ve.message + except AssertionError, ae: + assert MESSAGE == ae.message, 'Assertion message: ' + ae.message \ + + ' is different than expected: ' + MESSAGE + \ No newline at end of file