# need to remove the first line of the error message
error = str(e).split('\n', 1)[1]
self.assertEqual(sample_text_error, error)
+ else:
+ self.fail(f'{self.failureException} not raised')
def testAssertEqualSingleLine(self):
sample_text = "laden swallows fly slowly"
# need to remove the first line of the error message
error = str(e).split('\n', 1)[1]
self.assertEqual(sample_text_error, error)
+ else:
+ self.fail(f'{self.failureException} not raised')
def testAssertEqualwithEmptyString(self):
'''Verify when there is an empty string involved, the diff output
# need to remove the first line of the error message
error = str(e).split('\n', 1)[1]
self.assertEqual(sample_text_error, error)
+ else:
+ self.fail(f'{self.failureException} not raised')
def testAssertEqualMultipleLinesMissingNewlineTerminator(self):
'''Verifying format of diff output from assertEqual involving strings
# need to remove the first line of the error message
error = str(e).split('\n', 1)[1]
self.assertEqual(sample_text_error, error)
+ else:
+ self.fail(f'{self.failureException} not raised')
def testAssertEqualMultipleLinesMismatchedNewlinesTerminators(self):
'''Verifying format of diff output from assertEqual involving strings
# need to remove the first line of the error message
error = str(e).split('\n', 1)[1]
self.assertEqual(sample_text_error, error)
+ else:
+ self.fail(f'{self.failureException} not raised')
def testEqualityBytesWarning(self):
if sys.flags.bytes_warning: