Reputation: 5162
I'm doing that at the moment:
try:
self.assertIsNotNone(a)
except AssertionError:
try:
self.assertIsTrue(b)
except AssertionError:
try:
self.assertIn(c, C)
except AssertionError:
self.assertIsInstance(d, D)
(any of these assertions should pass)
How to do that better?
--
UPDATE: use any kind of assertion
Upvotes: 0
Views: 167
Reputation: 879083
You could use:
self.assertFalse(any(x is None for x in (a, b, c, d)))
Upvotes: 2