def test_parent_loops(self):
        template = Template("""% for x in 'ab':
${x} ${loop.index} <- outer loop
% for y in [0, 1]:
${y} ${loop.index} <- inner loop
${x} ${loop.parent.index} <- parent loop
% endfor
${x} ${loop.index} <- outer loop
% endfor""")
        code = template.code
        rendered = template.render()
        expected = [
                "a 0 <- outer loop",
                "a 0 <- parent loop",
                "b 1 <- outer loop",
                "b 1 <- parent loop"
            ]
        for line in expected:
            print(code)
            assert line in rendered, "The parent attribute of a loop gives "\
                    "you the previous loop context in the stack"
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Mako-0.8.1/test/test_loop.py/TestLoop.test_parent_loops/original