Testing and Debugging
Writing and Running Unit Tests with Unittest or Pytest
Example
# Example 1: Basic structure of unittest
import unittest
class Testing(unittest.TestCase):
def test_string(self):
a = 'some'
b = 'some'
self.assertEqual(a, b)
def test_boolean(self):
a = True
b = True
self.assertEqual(a, b)
if __name__ == '__main__':
unittest.main()Debugging Techniques and Tools
Code Profiling and Optimization
Example
Last updated