What assertion method will you use when you want to check if a specific exception will be raised?

Questions & AnswersCategory: PythonWhat assertion method will you use when you want to check if a specific exception will be raised?
Lokesh Kumar Staff asked 2 years ago

What assertion method will you use when you want to check if a specific exception will be raised?
a. unittest.TestCase.assertTrue()
b. unittest.TestCase.asserRegex()
c. unittest.TestCase.assertError()
d. unittest.TestCase.assertRaises()
e. unittest.TestCase.assertWarns()