Is there a way to use assertEqual, but with an alternate expected result? That is, if the test failed for one expected result it will test again with the alternate result.
Asked
Active
Viewed 101 times
-1
-
Please elaborate more. I assume you need to use try/exception handling instead of the assert. please check [this link](https://stackoverflow.com/questions/4606919/in-python-try-until-no-error) and if it didn't help, please elaborate more on your issue. – Novin Shahroudi Jan 29 '18 at 16:46
1 Answers
2
You could do
self.assertTrue(result == expected or result == alternate)

Code-Apprentice
- 81,660
- 23
- 145
- 268