Skip to content

Commit

Permalink
Simplify condition
Browse files Browse the repository at this point in the history
Fixes path temp id stripping only on snapshot `Path`s, not `str`ed  paths.
  • Loading branch information
john-kurkowski committed Dec 17, 2024
1 parent 4334349 commit 00d1d1f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ def matcher(data: Any, path: Any) -> Any:
return "CLIENT_SESSION_HERE"
elif isinstance(data, AsyncIterable):
return "ASYNC_ITERABLE_HERE"
elif isinstance(data, Path) or isinstance(data, io.IOBase):
return str(data).replace(tmp_path_str, "TMP_PATH_HERE")
elif isinstance(data, str):
without_tmp_id = tmp_id_re.sub(r"\g<ext>", data)
elif isinstance(data, Path | io.IOBase | str):
without_tmp_id = tmp_id_re.sub(r"\g<ext>", str(data))
without_path = without_tmp_id.replace(tmp_path_str, "TMP_PATH_HERE")
return without_path
return data
Expand Down

0 comments on commit 00d1d1f

Please sign in to comment.