Skip to content
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

prevent asynccontextmanager and sync contextmanager drifting #95902

Open
graingert opened this issue Aug 11, 2022 · 1 comment
Open

prevent asynccontextmanager and sync contextmanager drifting #95902

graingert opened this issue Aug 11, 2022 · 1 comment
Assignees
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@graingert
Copy link
Contributor

I think by adopting the testing approach taken by AsyncExitStack and ExitStack for contextlib.contextmanager it should be possible to prevent contextlib.asynccontextmanager from drifting in implementation

class TestAsyncExitStack(TestBaseExitStack, unittest.TestCase):
    class SyncAsyncExitStack(AsyncExitStack):
@graingert graingert added the type-feature A feature request or enhancement label Aug 11, 2022
@graingert graingert self-assigned this Aug 11, 2022
@graingert graingert added the tests Tests in the Lib/test dir label Aug 11, 2022
@graingert
Copy link
Contributor Author

I think doing this at the same time makes sense too #95888

Should make the tests run a bit faster and the traceback hacking clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant