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

fix default for Environment.overlay(enable_async) #2061

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

SamyCookie
Copy link
Contributor

Got a wrong behaviour with Environment.overlay and seems to me an obvious error code.

@kevin-brown
Copy link
Member

Do you have a test case that happens to reproduce the issue that this fixes?

@SamyCookie
Copy link
Contributor Author

Very simple :

from jinja2 import Environment
env = Environment(enable_async=True)
assert env.is_async == env.overlay().is_async, "overlay async state differs with parent"

@davidism
Copy link
Member

@SamyCookie I appreciate that you've submitted a fix, but please follow our contributing guide next time. You didn't open an issue, or explain the PR what the issue was and what the fix does. Your PR doesn't contain a test. While brevity is appreciated, you need to provide some detail rather than just dumping something on us and saying "it's obvious".

@davidism davidism changed the title Bugfix: wrong default argument for `Environment.overlay(enable_async)… fix default for Environment.overlay(enable_async) Dec 20, 2024
@davidism davidism added this to the 3.1.5 milestone Dec 20, 2024
@davidism davidism changed the base branch from main to stable December 20, 2024 02:22
@davidism
Copy link
Member

Rebased to target bug fix at stable instead of main. Added test. Added changelog.

@davidism davidism merged commit b4b28ec into pallets:stable Dec 20, 2024
12 checks passed
assert not env.is_async
assert not env.overlay().is_async
env_async = env.overlay(enable_async=True)
assert env_async.is_async
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test case of the concerning issue with overlay without any enable_async parameter , that is :

    assert env_async.overlay().is_async

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants