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
Additional test coverage for async rendering of native type templates #1807
Open
jayaddison
wants to merge
12
commits into
pallets:main
Choose a base branch
from
openculinary:issue-1806/pr-1511-additional-test-coverage
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Additional test coverage for async rendering of native type templates #1807
jayaddison
wants to merge
12
commits into
pallets:main
from
openculinary:issue-1806/pr-1511-additional-test-coverage
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 2903565.
…on case Adds additional test coverage for pallets#1511
This reverts commit 84c1836.
jayaddison
force-pushed
the
issue-1806/pr-1511-additional-test-coverage
branch
from
February 19, 2023 12:31
dcee833
to
78549cb
Compare
jayaddison
changed the title
Additional test coverage for #1511
Additional test coverage for async rendering of native type templates
Feb 19, 2023
graingert
reviewed
May 13, 2024
assert isinstance(result, str) | ||
assert result == "not bad" | ||
|
||
asyncio.run(async_render()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should use
def _asyncio_run(async_fn, *args):
return asyncio.run(async_fn(*args))
@pytest.fixture(params=[_asyncio_run, trio.run], ids=["asyncio", "trio"])
def run_async_fn(request):
return request.param
def test_string_concatenation(async_native_env, run_async_fn):
async def async_render():
t = async_native_env.from_string(
"{%- macro x(y) -%}{{ y }}{%- endmacro -%}{{- x('not') }} {{ x('bad') -}}"
)
result = await t.render_async()
assert isinstance(result, str)
assert result == "not bad"
run_async_fun(async_render)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist:
Add or update relevant docs, in the docs folder and in code.CHANGES.rst
summarizing the change and linking to the issue.Add.. versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
and, no tests failed.tox
PYTHONPATH=src pytest tests/test_nativetypes.py