def test_fail(self):
        """
        L{SynchronousTestCase.fail} raises
        L{SynchronousTestCase.failureException} with the given argument.
        """
        try:
            self.test.fail("failed")
        except self.test.failureException as result:
            self.assertEqual("failed", str(result))
        else:
            self.fail(
                "SynchronousTestCase.fail method did not raise "
                "SynchronousTestCase.failureException")

        L{SynchronousTestCase.fail} raises
        L{SynchronousTestCase.failureException} with the given argument.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_assertions.py