Pacific Beach Drive

Mike's Drive.

Follow me on GitHub

Unit testing

  • process of testing individual units or components of a software application to ensure they function correctly in isolation.

example of a unit test

import unittest

def add_numbers(a, b):
    return a + b

class TestAddNumbers(unittest.TestCase):
    def test_add_numbers(self):
        result = add_numbers(2, 3)
        self.assertEqual(result, 5)

if __name__ == '__main__':
    unittest.main()