Skip to content

Commit a5fd929

Browse files
committed
Improve tests
1 parent 5e6cec7 commit a5fd929

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_contextlib_async.py

+7
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,13 @@ async def woohoo(self, func, args, kwds):
281281
@_async_test
282282
async def test_recursive(self):
283283
depth = 0
284+
ncols = 0
285+
284286
@asynccontextmanager
285287
async def woohoo():
288+
nonlocal ncols
289+
ncols += 1
290+
286291
nonlocal depth
287292
before = depth
288293
depth += 1
@@ -296,6 +301,8 @@ async def recursive():
296301
await recursive()
297302

298303
await recursive()
304+
305+
self.assertEqual(ncols, 10)
299306
self.assertEqual(depth, 0)
300307

301308

0 commit comments

Comments
 (0)