@@ -99,7 +99,10 @@ def test_subclass(local_testdir):
9999 class MyPath (UPath ):
100100 pass
101101
102- path = MyPath (local_testdir )
102+ with pytest .warns (
103+ DeprecationWarning , match = r"MyPath\(...\) detected protocol '' .*"
104+ ):
105+ path = MyPath (local_testdir )
103106 assert str (path ) == str (pathlib .Path (local_testdir ))
104107 assert issubclass (MyPath , UPath )
105108 assert isinstance (path , pathlib .Path )
@@ -285,13 +288,16 @@ def __fspath__(self):
285288def test_access_to_private_kwargs_and_url (urlpath ):
286289 # fixme: this should be deprecated...
287290 pth = UPath (urlpath )
288- assert isinstance (pth ._kwargs , Mapping )
289- assert pth ._kwargs == {}
291+ with pytest .warns (DeprecationWarning , match = "UPath._kwargs is deprecated" ):
292+ assert isinstance (pth ._kwargs , Mapping )
293+ with pytest .warns (DeprecationWarning , match = "UPath._kwargs is deprecated" ):
294+ assert pth ._kwargs == {}
290295 assert isinstance (pth ._url , SplitResult )
291296 assert pth ._url .scheme == "" or pth ._url .scheme in pth .fs .protocol
292297 assert pth ._url .path == pth .path
293298 subpth = pth / "foo"
294- assert subpth ._kwargs == {}
299+ with pytest .warns (DeprecationWarning , match = "UPath._kwargs is deprecated" ):
300+ assert subpth ._kwargs == {}
295301 assert isinstance (subpth ._url , SplitResult )
296302 assert subpth ._url .scheme == "" or subpth ._url .scheme in subpth .fs .protocol
297303 assert subpth ._url .path == subpth .path
0 commit comments