Did I find the right examples for you? yes no

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
Check that matchee is matched by matcher, but delay the assertion failure.

This method behaves similarly to ``assertThat``, except that a failed
match does not exit the test immediately. The rest of the test code will
continue to run, and the test will be marked as failing after the test
has finished.

:param matchee: An object to match with matcher.
:param matcher: An object meeting the testtools.Matcher protocol.
:param message: If specified, show this message with any failed match.

src/t/e/testtools-0.9.35/testtools/tests/test_testcase.py   testtools(Download)
    def test_expectThat_matches_clean(self):
        class Matcher(object):
            def match(self, foo):
                return None
        self.expectThat("foo", Matcher())
 
    def test_expectThat_mismatch_fails_test(self):
        class Test(TestCase):
            def test(self):
                self.expectThat("foo", Equals("bar"))
            def test(self):
                self.expectThat("foo", Equals("bar"))
                Test.marker = True
        result = Test("test").run()
        self.assertFalse(result.wasSuccessful())
            def test(self):
                self.expectThat("foo", Equals("bar"))
        test = Test("test")
        result = test.run()
        details = test.getDetails()

src/t/e/testtools-HEAD/testtools/tests/test_testcase.py   testtools(Download)
    def test_expectThat_matches_clean(self):
        class Matcher(object):
            def match(self, foo):
                return None
        self.expectThat("foo", Matcher())
 
    def test_expectThat_mismatch_fails_test(self):
        class Test(TestCase):
            def test(self):
                self.expectThat("foo", Equals("bar"))
            def test(self):
                self.expectThat("foo", Equals("bar"))
                Test.marker = True
        result = Test("test").run()
        self.assertFalse(result.wasSuccessful())
            def test(self):
                self.expectThat("foo", Equals("bar"))
        test = Test("test")
        result = test.run()
        details = test.getDetails()