@@ -23,7 +23,7 @@ def test_templates(tmpdir: Path, test_client_factory: TestClientFactory) -> None
2323 with open (path , "w" ) as file :
2424 file .write ("<html>Hello, <a href='{{ url_for('homepage') }}'>world</a></html>" )
2525
26- async def homepage (request : Request ) -> Response :
26+ def homepage (request : Request ) -> Response :
2727 return templates .TemplateResponse (request , "index.html" )
2828
2929 app = Starlette (debug = True , routes = [Route ("/" , endpoint = homepage )])
@@ -40,7 +40,7 @@ def test_calls_context_processors(tmp_path: Path, test_client_factory: TestClien
4040 path = tmp_path / "index.html"
4141 path .write_text ("<html>Hello {{ username }}</html>" )
4242
43- async def homepage (request : Request ) -> Response :
43+ def homepage (request : Request ) -> Response :
4444 return templates .TemplateResponse (request , "index.html" )
4545
4646 def hello_world_processor (request : Request ) -> dict [str , str ]:
@@ -69,7 +69,7 @@ def test_template_with_middleware(tmpdir: Path, test_client_factory: TestClientF
6969 with open (path , "w" ) as file :
7070 file .write ("<html>Hello, <a href='{{ url_for('homepage') }}'>world</a></html>" )
7171
72- async def homepage (request : Request ) -> Response :
72+ def homepage (request : Request ) -> Response :
7373 return templates .TemplateResponse (request , "index.html" )
7474
7575 class CustomMiddleware (BaseHTTPMiddleware ):
@@ -96,15 +96,15 @@ def test_templates_with_directories(tmp_path: Path, test_client_factory: TestCli
9696 template_a = dir_a / "template_a.html"
9797 template_a .write_text ("<html><a href='{{ url_for('page_a') }}'></a> a</html>" )
9898
99- async def page_a (request : Request ) -> Response :
99+ def page_a (request : Request ) -> Response :
100100 return templates .TemplateResponse (request , "template_a.html" )
101101
102102 dir_b = tmp_path .resolve () / "b"
103103 dir_b .mkdir ()
104104 template_b = dir_b / "template_b.html"
105105 template_b .write_text ("<html><a href='{{ url_for('page_b') }}'></a> b</html>" )
106106
107- async def page_b (request : Request ) -> Response :
107+ def page_b (request : Request ) -> Response :
108108 return templates .TemplateResponse (request , "template_b.html" )
109109
110110 app = Starlette (
@@ -150,7 +150,7 @@ def test_templates_with_environment(tmpdir: Path, test_client_factory: TestClien
150150 with open (path , "w" ) as file :
151151 file .write ("<html>Hello, <a href='{{ url_for('homepage') }}'>world</a></html>" )
152152
153- async def homepage (request : Request ) -> Response :
153+ def homepage (request : Request ) -> Response :
154154 return templates .TemplateResponse (request , "index.html" )
155155
156156 env = jinja2 .Environment (loader = jinja2 .FileSystemLoader (str (tmpdir )))
0 commit comments