]> 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:

Consistently wrap two context managers in parens (in --preview). (#3589)
[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 # output
71
72
73 with (
74     make_context_manager1() as cm1,
75     make_context_manager2() as cm2,
76     make_context_manager3() as cm3,
77     make_context_manager4() as cm4,
78 ):
79     pass
80
81
82 # Leading comment
83 with (
84     make_context_manager1() as cm1,
85     make_context_manager2(),
86     make_context_manager3() as cm3,
87     make_context_manager4(),
88 ):
89     pass
90
91
92 with new_new_new1() as cm1, new_new_new2():
93     pass
94
95
96 with new_new_new1() as cm1, new_new_new2():
97     pass
98
99
100 # Leading comment.
101 with (
102     # First comment.
103     new_new_new1() as cm1,
104     # Second comment.
105     new_new_new2(),
106     # Last comment.
107 ):
108     pass
109
110
111 with (
112     this_is_a_very_long_call(
113         looong_arg1=looong_value1, looong_arg2=looong_value2
114     ) as cm1,
115     this_is_a_very_long_call(
116         looong_arg1=looong_value1,
117         looong_arg2=looong_value2,
118         looong_arg3=looong_value3,
119         looong_arg4=looong_value4,
120     ) as cm2,
121 ):
122     pass
123
124
125 with (
126     mock.patch.object(self.my_runner, "first_method", autospec=True) as mock_run_adb,
127     mock.patch.object(
128         self.my_runner, "second_method", autospec=True, return_value="foo"
129     ),
130 ):
131     pass
132
133
134 with xxxxxxxx.some_kind_of_method(
135     some_argument=[
136         "first",
137         "second",
138         "third",
139     ]
140 ).another_method() as cmd:
141     pass