Skip to content

Commit e824a8b

Browse files
committed
Parameterize test
1 parent 16b0218 commit e824a8b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

upath/tests/test_core.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ def path(self, local_testdir):
9999
self.path = UPath(path)
100100

101101

102-
def test_create_from_type(local_testdir):
103-
paths = [local_testdir, "s3://bucket/folder", "gs://bucket/folder"]
104-
for path in paths:
105-
parts = path.split("/")
106-
parent = "/".join(parts[:-1])
107-
upath = UPath(path)
108-
cast = type(upath)
109-
new = cast(parent)
110-
assert isinstance(new, cast)
102+
PATHS = ["/tmp/abc", "s3://bucket/folder", "gs://bucket/folder"]
103+
104+
105+
@pytest.mark.parametrize("path", PATHS)
106+
def test_create_from_type(path):
107+
parts = path.split("/")
108+
parent = "/".join(parts[:-1])
109+
upath = UPath(path)
110+
cast = type(upath)
111+
new = cast(parent)
112+
assert isinstance(new, cast)

0 commit comments

Comments
 (0)