From c718c65849865b270d028cb4361ec2e185eb00e2 Mon Sep 17 00:00:00 2001 From: hp310780 <43389959+hp310780@users.noreply.github.com> Date: Sun, 31 Oct 2021 16:27:47 +0000 Subject: [PATCH] Add asserts for path variable types --- src/_pytest/pathlib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index f641e6491..b44753e1a 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -685,6 +685,8 @@ def bestrelpath(directory: Path, dest: Path) -> str: If no such path can be determined, returns dest. """ + assert isinstance(directory, Path) + assert isinstance(dest, Path) if dest == directory: return os.curdir # Find the longest common directory.