def write_test_output(self, name=None, div_id=None):
        if div_id is None:
            div_id = 'tests'
        element = DOM.getElementById(div_id)
        output = element.innerHTML

        if self.test_gen_folder is None:
            if self.tests_outstanding is None:
                self.tests_outstanding = 0
            self.tests_outstanding += 1
            self.do_test(output, name)
            return

        # otherwise assume we're running pyjd, and have file-system
        # access
        import os
        if name:
            fname = "%s.%s.txt" % (self.current_test_name, name)
        else:
            fname = self.current_test_name % "%s.txt"
        f = open(os.path.join(self.test_gen_folder, fname), "w")
        f.write(output)
        f.close()

        if self.tests_outstanding is None:
            self.tests_outstanding = 0

        return False
dataset/ETHPy150Open anandology/pyjamas/examples/uitest/UnitTest.py/UnitTest.write_test_output/swapped operands of `%`