def test_withStatementSubscriptUndefined():
    flakes('''
    from __future__ import with_statement
    import foo
    with open('foo') as foo[bar]:
        pass
    ''', m.UndefinedName)
An undefined name warning is emitted if the subscript used as the target of a with statement is not defined.
dataset/ETHPy150Open timothycrosley/frosted/frosted/test/test_other.py/test_withStatementSubscriptUndefined