In python tests I know how to check the expecting value of a variable:
def test_smth(self):
var = 4
self.assertEqual(var, 4)
But is it possible to check with one or another variable without flooding code with if
?
Smth pretty like following (not valid example):
def test_smth(self):
var = 5
self.assertEqual(var, 4 or 5)
Aucun commentaire:
Enregistrer un commentaire