assertRaises(exception, callable, *args, **kwds) assertRaises(exception, msg=None) Test that an exception is raised
fail(msg=None) Signals a test failure unconditionally, with msg or None for the error message.
class typing.AnyStr AnyStr is a type variable defined as AnyStr = TypeVar('AnyStr', str, bytes).
class unittest.TestLoader The TestLoader class is used to create test suites from classes and modules. Normally
unittest.mock.mock_open(mock=None, read_data=None) A helper function to create a mock to replace the use of
@unittest.expectedFailure Mark the test as an expected failure. If the test fails when run, the test is not counted as a failure
side_effect This can either be a function to be called when the mock is called, an iterable or an exception (class or instance)
Page 28 of 28