Exemplo n.º 1
0
    def test_exc_value(self):
        e = RuntimeError("You lose!")

        def raiser():
            raise e

        self.assertThat(raiser, raises(e))
Exemplo n.º 2
0
    def test_exc_value(self):
        e = RuntimeError("You lose!")

        def raiser():
            raise e

        self.assertThat(raiser, raises(e))
Exemplo n.º 3
0
 def test_exc_type(self):
     self.assertThat(lambda: 1/0, raises(ZeroDivisionError))