Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-40816 Add AsyncContextDecorator class #20516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve tests
  • Loading branch information
heckad committed Jul 23, 2020
commit a5fd9292023fb756d520db58993a648a51ce5cbe
7 changes: 7 additions & 0 deletions 7 Lib/test/test_contextlib_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,13 @@ async def woohoo(self, func, args, kwds):
@_async_test
async def test_recursive(self):
heckad marked this conversation as resolved.
Show resolved Hide resolved
depth = 0
heckad marked this conversation as resolved.
Show resolved Hide resolved
ncols = 0

@asynccontextmanager
async def woohoo():
nonlocal ncols
ncols += 1

nonlocal depth
before = depth
depth += 1
heckad marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -296,6 +301,8 @@ async def recursive():
await recursive()

await recursive()

self.assertEqual(ncols, 10)
self.assertEqual(depth, 0)
heckad marked this conversation as resolved.
Show resolved Hide resolved


Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.