]> git.madduck.net Git - etc/vim.git/blob - tests/data/preview_context_managers/targeting_py39.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Check self format for the whole repo (#3750)
[etc/vim.git] / tests / data / preview_context_managers / targeting_py39.py
1 with \
2      make_context_manager1() as cm1, \
3      make_context_manager2() as cm2, \
4      make_context_manager3() as cm3, \
5      make_context_manager4() as cm4 \
6 :
7     pass
8
9
10 # Leading comment
11 with \
12      make_context_manager1() as cm1, \
13      make_context_manager2(), \
14      make_context_manager3() as cm3, \
15      make_context_manager4() \
16 :
17     pass
18
19
20 with \
21      new_new_new1() as cm1, \
22      new_new_new2() \
23 :
24     pass
25
26
27 with (
28      new_new_new1() as cm1,
29      new_new_new2()
30 ):
31     pass
32
33
34 # Leading comment.
35 with (
36      # First comment.
37      new_new_new1() as cm1,
38      # Second comment.
39      new_new_new2()
40      # Last comment.
41 ):
42     pass
43
44
45 with \
46     this_is_a_very_long_call(looong_arg1=looong_value1, looong_arg2=looong_value2) as cm1, \
47     this_is_a_very_long_call(looong_arg1=looong_value1, looong_arg2=looong_value2, looong_arg3=looong_value3, looong_arg4=looong_value4) as cm2 \
48 :
49     pass
50
51
52 with mock.patch.object(
53     self.my_runner, "first_method", autospec=True
54 ) as mock_run_adb, mock.patch.object(
55     self.my_runner, "second_method", autospec=True, return_value="foo"
56 ):
57     pass
58
59
60 with xxxxxxxx.some_kind_of_method(
61     some_argument=[
62         "first",
63         "second",
64         "third",
65     ]
66 ).another_method() as cmd:
67     pass
68
69
70 async def func():
71     async with \
72         make_context_manager1() as cm1, \
73         make_context_manager2() as cm2, \
74         make_context_manager3() as cm3, \
75         make_context_manager4() as cm4 \
76     :
77         pass
78
79     async with some_function(
80         argument1, argument2, argument3="some_value"
81     ) as some_cm, some_other_function(
82         argument1, argument2, argument3="some_value"
83     ):
84         pass
85
86
87 # output
88
89
90 with (
91     make_context_manager1() as cm1,
92     make_context_manager2() as cm2,
93     make_context_manager3() as cm3,
94     make_context_manager4() as cm4,
95 ):
96     pass
97
98
99 # Leading comment
100 with (
101     make_context_manager1() as cm1,
102     make_context_manager2(),
103     make_context_manager3() as cm3,
104     make_context_manager4(),
105 ):
106     pass
107
108
109 with new_new_new1() as cm1, new_new_new2():
110     pass
111
112
113 with new_new_new1() as cm1, new_new_new2():
114     pass
115
116
117 # Leading comment.
118 with (
119     # First comment.
120     new_new_new1() as cm1,
121     # Second comment.
122     new_new_new2(),
123     # Last comment.
124 ):
125     pass
126
127
128 with (
129     this_is_a_very_long_call(
130         looong_arg1=looong_value1, looong_arg2=looong_value2
131     ) as cm1,
132     this_is_a_very_long_call(
133         looong_arg1=looong_value1,
134         looong_arg2=looong_value2,
135         looong_arg3=looong_value3,
136         looong_arg4=looong_value4,
137     ) as cm2,
138 ):
139     pass
140
141
142 with (
143     mock.patch.object(self.my_runner, "first_method", autospec=True) as mock_run_adb,
144     mock.patch.object(
145         self.my_runner, "second_method", autospec=True, return_value="foo"
146     ),
147 ):
148     pass
149
150
151 with xxxxxxxx.some_kind_of_method(
152     some_argument=[
153         "first",
154         "second",
155         "third",
156     ]
157 ).another_method() as cmd:
158     pass
159
160
161 async def func():
162     async with (
163         make_context_manager1() as cm1,
164         make_context_manager2() as cm2,
165         make_context_manager3() as cm3,
166         make_context_manager4() as cm4,
167     ):
168         pass
169
170     async with (
171         some_function(argument1, argument2, argument3="some_value") as some_cm,
172         some_other_function(argument1, argument2, argument3="some_value"),
173     ):
174         pass