summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_types.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/test_types.py b/tests/test_types.py
index 43e34bb..dff8172 100644
--- a/tests/test_types.py
+++ b/tests/test_types.py
@@ -127,16 +127,14 @@ def test_symlink_resolution(tmpdir, sym_file, abs_fun):
ctx = click.Context(click.Command("do_stuff"))
rv = click.Path(resolve_path=True).convert(sym_path, None, ctx)
- if os.path.isabs(rv):
- # os.readlink prepends path prefixes to absolute
- # links in windows.
- # https://docs.microsoft.com/en-us/windows/win32/
- # ... fileio/naming-a-file#win32-file-namespaces
- #
- # Here we strip win32 path prefix from the resolved path
- rv_drive, rv_path = os.path.splitdrive(rv)
- stripped_rv_drive = rv_drive.split(os.path.sep)[-1]
- rv = os.path.join(stripped_rv_drive, rv_path)
-
- assert pathlib.Path(rv) == pathlib.Path(real_path)
+ # os.readlink prepends path prefixes to absolute
+ # links in windows.
+ # https://docs.microsoft.com/en-us/windows/win32/
+ # ... fileio/naming-a-file#win32-file-namespaces
+ #
+ # Here we strip win32 path prefix from the resolved path
+ rv_drive, rv_path = os.path.splitdrive(rv)
+ stripped_rv_drive = rv_drive.split(os.path.sep)[-1]
+ rv = os.path.join(stripped_rv_drive, rv_path)
+
assert rv == real_path