

def test_list_comprehensions(self):
    code = '[i for i in [-1, -2, 1, 2, 3]]'
    assert (str(eval(code)) == normallist(evalpy(code)))
    code = '[i for i in [-1, -2, 1, 2, 3] if i > 0 and i < 3]'
    assert (str(eval(self)) == normallist(evalpy(code)))
    code = '[i for i in [-1, -2, 1, 2, 3] if i > 0 if i < 3]'
    assert (str(eval(code)) == normallist(evalpy(code)))
    code = '[i*j for i in [-1, -2, 1, 2, 3] if i > 0 for j in [1, 10, 100] if j<100]'
    assert (str(eval(code)) == normallist(evalpy(code)))
    code = '[i*j*k for i in [1, 2, 3] for j in [1, 10] for k in [5, 7]]'
    assert (str(eval(code)) == normallist(evalpy(code)))
    code = '[(i, j) for i in [1, 2, 3] for j in [1, 10]]'
    assert (str(eval(code)).replace('(', '[').replace(')', ']') == normallist(evalpy(code)))
    code = '[(i, j) for i, j in [[1, 2], [3, 4], [5, 6]]]'
    assert (str(eval(code)).replace('(', '[').replace(')', ']') == normallist(evalpy(code)))

dataset/ETHPy150Open zoofIO/flexx/flexx/pyscript/tests/test_parser2.py TestConrolFlow.test_list_comprehensions/VarMisuse@43/115 `code`->`self`