]> git.madduck.net Git - etc/vim.git/blob - tests/data/cases/preview_context_managers_39.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:

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