def test_boolsOnly(self):
        """
        L{util._replaceIf}'s condition argument only accepts bools.
        """
        with self.assertRaises(ValueError) as e:

            @util._replaceIf("hi", "there")
            def test():
                """
                Some test function.
                """

        self.assertEqual(e.exception.args[0],
                         ("condition argument to _replaceIf requires a bool, "
                          "not 'hi'"))

        L{util._replaceIf}'s condition argument only accepts bools.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_util.py