def test_direct_rule_call():

    def grammar():  return rule1, rule2
    def rule1():    return "a"
    def rule2():    return rule1

    call_count = [0]

    class DummySemAction(SemanticAction):
        def first_pass(self, parser, node, nodes):
            call_count[0] += 1
            return SemanticAction.first_pass(self, parser, node, nodes)

    # Sem action is attached to rule2 only but
    # this bug will attach it to rule1 also resulting in
    # wrong call count.
    rule2.sem = DummySemAction()

    parser = ParserPython(grammar)
    parse_tree = parser.parse("aa")
    parser.getASG()

    assert call_count[0] == 1, "Semantic action should be called once!"
Test the creation of a simple XlsxWriter file with conditional formatting.
dataset/ETHPy150Open igordejanovic/Arpeggio/tests/unit/regressions/test_direct_rule_call.py/test_direct_rule_call--crossover with--dataset/ETHPy150Open jmcnamara/XlsxWriter/xlsxwriter/test/comparison/test_cond_format03.py/TestCompareXLSXFiles.test_create_file