@pytest.mark.skipif('''version_info < (2, 7)''')
def test_redefinedInDictComprehension():
    flakes('''
    a = 1
    {1: 42 for a, b in [(1, 2)]}
    ''')
    flakes('''
    class A:
        a = 1
        {1: 42 for a, b in [(1, 2)]}
    ''')
    flakes('''
    def f():
        a = 1
        {1: 42 for a, b in [(1, 2)]}
    ''', m.UnusedVariable)
    flakes('''
    {1: 42 for a, b in [(1, 2)]}
    {1: 42 for a, b in [(1, 2)]}
    ''')
    flakes('''
    for a, b in [(1, 2)]:
        pass
    {1: 42 for a, b in [(1, 2)]}
    ''')
Test that reusing a variable in a dict comprehension does not raise a warning.
dataset/ETHPy150Open timothycrosley/frosted/frosted/test/test_other.py/test_redefinedInDictComprehension