Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / functional / confusing_with_statement.py @ 745

History | View | Annotate | Download (643 Bytes)

1
# pylint: disable=undefined-variable,not-context-manager,missing-docstring
2

    
3
# both context managers are named
4
with one as first, two as second:
5
    pass
6

    
7
# first matched as tuple; this is ok
8
with one as (first, second), third:
9
    pass
10

    
11
# the first context manager doesn't have as name
12
with one, two as second:
13
    pass
14

    
15
# the second is a function call; this is ok
16
with one as first, two():
17
    pass
18

    
19
# nested with statements; make sure no message is emited
20
# this could be a false positive on Py2
21
with one as first:
22
    with two:
23
        pass
24

    
25
# ambiguous looking with statement
26
with one as first, two:  # [confusing-with-statement]
27
    pass