I'm writing a unittest that will be run on my class's code. For one of the functions they must write, there are two possible return values that they could return and either one is okay for my purposes.
I've been using
actual = my_function_call(arg1, arg2)
self.assertEqual(actual, expected)
But this doesn't work for accepting one of two valid return values, so I've changed it to:
actual = my_function_call(arg1, arg2)
self.assertEqual(actual == expected1 or actual == expected2, True)
Is there a way to do this that isn't as hacky?
self.assertTrue(actual == expected1 or actual == expected2)