This question already has an answer here:
- Customize AssertionError in Python 3 answers
I want add some text for all failed tests (Without updating all text message).
import unittest
class TestCase(unittest.TestCase):
def test1(self):
self.assertTrue(False, "FAIL!")
def test2(self):
self.assertLessEqual(10, 2, "FAIL!")
if __name__ == "__main__":
unittest.main()
Now I see result: AssertionError: FAIL!
My goal is to see: AssertionError: FAIL! + Some my debug information
Aucun commentaire:
Enregistrer un commentaire