Skip to content

Commit d16f6c7

Browse files
committed
add tests about parenthesized context managers
1 parent 126a522 commit d16f6c7

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
with (CtxManager() as example):
2+
...
3+
4+
with (CtxManager1(), CtxManager2()):
5+
...
6+
7+
with (CtxManager1() as example, CtxManager2()):
8+
...
9+
10+
with (CtxManager1(), CtxManager2() as example):
11+
...
12+
13+
with (CtxManager1() as example1, CtxManager2() as example2):
14+
...
15+
16+
with (
17+
CtxManager1() as example1,
18+
CtxManager2() as example2,
19+
CtxManager3() as example3,
20+
):
21+
...

tests/test_format.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@
7070
"percent_precedence",
7171
]
7272

73-
PY310_CASES = ["pattern_matching_simple", "pattern_matching_complex"]
73+
PY310_CASES = [
74+
"pattern_matching_simple",
75+
"pattern_matching_complex",
76+
"parenthesized_context_managers",
77+
]
7478

7579
SOURCES = [
7680
"src/black/__init__.py",

0 commit comments

Comments
 (0)