File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,9 @@ def __repr__(self) -> str:
244244 if sys .version_info >= (3 , 13 ):
245245 full_match = _wrap_method (pathlib .Path .full_match )
246246
247+ def as_uri (self ) -> str :
248+ return pathlib .Path .as_uri (self )
249+
247250
248251@final
249252class PosixPath (Path , pathlib .PurePosixPath ):
Original file line number Diff line number Diff line change @@ -168,10 +168,8 @@ def test_forward_properties_rewrap(path: trio.Path) -> None:
168168 assert isinstance (path .parent , trio .Path )
169169
170170
171- async def test_forward_methods_without_rewrap (path : trio .Path ) -> None :
172- path = await path .parent .resolve ()
173-
174- assert path .as_uri ().startswith ("file:///" )
171+ def test_forward_methods_without_rewrap (path : trio .Path ) -> None :
172+ assert "totally-unique-path" in str (path .joinpath ("totally-unique-path" ))
175173
176174
177175def test_repr () -> None :
@@ -232,6 +230,12 @@ async def test_globmethods(path: trio.Path) -> None:
232230 assert entries == {"_bar.txt" , "bar.txt" }
233231
234232
233+ async def test_as_uri (path : trio .Path ) -> None :
234+ path = await path .parent .resolve ()
235+
236+ assert path .as_uri ().startswith ("file:///" )
237+
238+
235239async def test_iterdir (path : trio .Path ) -> None :
236240 # Populate a directory
237241 await path .mkdir ()
You can’t perform that action at this time.
0 commit comments