예제 #1
0
def test__when_a_test_fails__raises_an_error():
    reset()

    @it
    def failing_test(self):
        expect(1).to_be(2)

    expect(lambda: run_tests(test_collection.current_describe, ExceptionReporter())) \
        .to_raise_error_with_message(anything())
예제 #2
0
def test__anything__satisfies_to_be():
    expect(anything()).to_be(1234)
    expect(1234).to_be(anything())
예제 #3
0
def test__to_raise_error_with_message__can_pass_with_matcher():
    def error_method():
        raise Exception("some message")

    expect(error_method).to_raise_error_with_message(anything())
예제 #4
0
def test__to_be__with_a_matcher_can_pass():
    expect(anything()).to_be(1234)
    expect(1234).to_be(anything())