def fail(self, msg=None):
        self.startTest()
        self.tests_failed+=1

        if not msg:
            msg="assertion failed"
        else:
            msg = str(msg)

        octothorp = msg.find("#")
        has_bugreport = octothorp >= 0 and msg[octothorp+1].isdigit()
        if has_bugreport:
            name_fmt = "Known issue"
            bg_colour="#ffc000"
            fg_colour="#000000"
        else:
            bg_colour="#ff8080"
            fg_colour="#000000"
            name_fmt = "Test failed"
        output="<table style='padding-left:20px;padding-right:20px;' cellpadding=2 width=100%><tr><td bgcolor='" + bg_colour + "'><font color='" + fg_colour + "'>"
        write(output)
        title="<b>" + self.getNameFmt(name_fmt) + "</b>"
        write(title + msg)
        output="</font></td></tr></table>"
        output+= "\n"
        write(output)
        if sys.platform in ['mozilla', 'ie6', 'opera', 'oldmoz', 'safari']:
            from __pyjamas__ import JS
            JS("""if (typeof @{{!console}} != 'undefined') {
                if (typeof @{{!console}}.error == 'function') @{{!console}}.error(@{{msg}});
                if (typeof @{{!console}}.trace == 'function') @{{!console}}.trace();
            }""")
        return False
dataset/ETHPy150Open anandology/pyjamas/examples/libtest/UnitTest.py/UnitTest.fail/original