File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -246,9 +246,7 @@ def __repr__(self) -> str:
246
246
247
247
@final
248
248
class PosixPath (Path , pathlib .PurePosixPath ):
249
- """An async :class:`pathlib.PosixPath` that executes blocking methods in :meth:`trio.to_thread.run_sync`.
250
-
251
- """
249
+ """An async :class:`pathlib.PosixPath` that executes blocking methods in :meth:`trio.to_thread.run_sync`."""
252
250
253
251
__slots__ = ()
254
252
@@ -257,9 +255,7 @@ class PosixPath(Path, pathlib.PurePosixPath):
257
255
258
256
@final
259
257
class WindowsPath (Path , pathlib .PureWindowsPath ):
260
- """An async :class:`pathlib.WindowsPath` that executes blocking methods in :meth:`trio.to_thread.run_sync`.
261
-
262
- """
258
+ """An async :class:`pathlib.WindowsPath` that executes blocking methods in :meth:`trio.to_thread.run_sync`."""
263
259
264
260
__slots__ = ()
265
261
Original file line number Diff line number Diff line change @@ -27,6 +27,16 @@ def method_pair(
27
27
return getattr (sync_path , method_name ), getattr (async_path , method_name )
28
28
29
29
30
+ @pytest .mark .skipif (os .name == "nt" , reason = "OS is not posix" )
31
+ async def test_instantiate_posix () -> None :
32
+ assert isinstance (trio .Path (), trio .PosixPath )
33
+
34
+
35
+ @pytest .mark .skipif (os .name != "nt" , reason = "OS is not Windows" )
36
+ async def test_instantiate_windows () -> None :
37
+ assert isinstance (trio .Path (), trio .WindowsPath )
38
+
39
+
30
40
async def test_open_is_async_context_manager (path : trio .Path ) -> None :
31
41
async with await path .open ("w" ) as f :
32
42
assert isinstance (f , AsyncIOWrapper )
You can’t perform that action at this time.
0 commit comments