File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 33import shutil
44from pathlib import Path
55
6+ import anyio
67import httpx
78import pytest
89from asgi_lifespan import LifespanManager
@@ -23,10 +24,11 @@ def anyio_backend():
2324
2425async def test_application (tmp_path , anyio_backend ):
2526 src_dir = tmp_path / "docs"
26- index_file = src_dir / "index.rst"
2727 out_dir = tmp_path / "build"
2828 shutil .copytree (ROOT / "docs" , tmp_path / "docs" )
2929 out_dir .mkdir (parents = True , exist_ok = True )
30+ index_file = anyio .Path (src_dir / "index.rst" )
31+ await index_file .write_text ("hello" )
3032
3133 url_host = "127.0.0.1:7777"
3234 ignore_handler = IgnoreFilter ([out_dir ], [])
@@ -47,8 +49,7 @@ async def test_application(tmp_path, anyio_backend):
4749 assert response .status_code == 200
4850
4951 async with aconnect_ws ("/websocket-reload" , client ) as websocket :
50- with index_file .open ("a" ) as f :
51- f .write ("hello" )
52+ await index_file .write_text ("world" )
5253
5354 data = await websocket .receive_text ()
5455 assert data == "refresh"
You can’t perform that action at this time.
0 commit comments