def test_div(self): # method should start with test result = Basic.Divide(10, 5) self.assertEqual(result, 2) # To check for the error raise use context manager with self.assertRaises(ZeroDivisionError): Basic.Divide(10, 0)