def test_traverse_postorder_duplicate_subtrees():
 subtree = ET(u'+', ET(1), ET(2))
 tree = ET(u'+', subtree, subtree)
 traversal = [n.value for n in tree.traverse_postorder()]
 assert (traversal == [1, 2, u'+', 1, 2, u'+', u'+'])

def test_traverse_postorder_duplicate_subtrees ( ) : subtree = ET ( u'+' , ET ( 1 ) , ET ( 2 ) ) tree = ET ( u'+' , subtree , subtree ) traversal = [ n . value for n in tree . traverse_postorder ( ) ] assert ( traversal == [ 1 , 2 , u'+' , 1 , 2 , u'+' , u'+' ] )
regression test for a bug in expressiontree .