The unittest Framework for Writing and Running Tests in Python


Write tests to automatically verify your code works as expected.

Source Code

import unittest

class TestStringMethods(unittest.TestCase):
    def test_upper(self):
        self.assertEqual('foo'.upper(), 'FOO')

if __name__ == '__main__':
    unittest.main()
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments