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:
244
244
if sys .version_info >= (3 , 13 ):
245
245
full_match = _wrap_method (pathlib .Path .full_match )
246
246
247
+ def as_uri (self ) -> str :
248
+ return pathlib .Path .as_uri (self )
249
+
247
250
248
251
@final
249
252
class 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:
168
168
assert isinstance (path .parent , trio .Path )
169
169
170
170
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" ))
175
173
176
174
177
175
def test_repr () -> None :
@@ -232,6 +230,12 @@ async def test_globmethods(path: trio.Path) -> None:
232
230
assert entries == {"_bar.txt" , "bar.txt" }
233
231
234
232
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
+
235
239
async def test_iterdir (path : trio .Path ) -> None :
236
240
# Populate a directory
237
241
await path .mkdir ()
You can’t perform that action at this time.
0 commit comments