Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
 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)