def test_assert_raises_and_contains(self): def no_fail(): return def fail(): raise ValueError("choose one of the correct values") with assert_raises(AssertionError): assert_raises_and_contains(ValueError, "two of", fail) with assert_raises(AssertionError): assert_raises_and_contains(Exception, "anything", no_fail)
def test_assert_raises_and_contains(self): def fail(): raise ValueError("choose one of the correct values") assert_raises_and_contains(ValueError, "one of", fail)