Is there a way to use assertTrue()
or assertFalse()
like a function in pytest for python unittests?
I have a function which returns a list of elements. If the list is empty the test needs to fail through assertion.
Is there anything like below:
assertFalse(function_returns_list()), "the list is non empty, contains error elements"