Skip to content

Commit

Permalink
Fix type hints evaluation caused by future annotations import
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergi Pons Freixes committed Aug 22, 2024
1 parent 4dac10c commit 2850d3d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
from jinja2_fragments.quart import render_block as quart_render_block
from jinja2_fragments.sanic import render as sanic_render

# fmt: off
# Needed for type hints because we are using `from __future__ import annotations`
# to support Python <3.10. See
# https://stackoverflow.com/questions/66734640/any-downsides-to-using-from-future-import-annotations-everywhere
# for shortcomings of using the annotations import,
from litestar.contrib.htmx.request import HTMXRequest # noqa isort: skip
from litestar.response import Template # noqa isort: skip
# fmt: on

NAME = "Guido"
LUCKY_NUMBER = "42"

Expand Down Expand Up @@ -308,9 +317,9 @@ def sanic_client(sanic_app: sanic.Sanic):
def litestar_app():
from pathlib import Path

from litestar.contrib.htmx.request import HTMXRequest
from litestar.contrib.htmx.request import HTMXRequest # noqa
from litestar.contrib.jinja import JinjaTemplateEngine
from litestar.response import Response, Template
from litestar.response import Response, Template # noqa
from litestar.template.config import TemplateConfig

from jinja2_fragments.litestar import BlockNotFoundError, HTMXBlockTemplate
Expand Down

0 comments on commit 2850d3d

Please sign in to comment.