doctestprinter.strip_base_path¶
-
doctestprinter.
strip_base_path
(base_path_to_strip: Union[str, pathlib.Path], path_to_show: Union[str, pathlib.Path]) → str¶ Strips the given base path from the path to show and performing
repr_posix_path()
on the result.Examples
>>> strip_base_path("/a/root/path", "/a/root/path/some/place") '... /some/place' >>> strip_base_path("\\a\\root\\path", "/a/root/path/some/place") '... /some/place' >>> strip_base_path("/a/root/path", "\\a\\root\\path\\some\\place") '... /some/place'
- Parameters
base_path_to_strip – The base path, which should be removed from the view.
path_to_show – The path which is going to be viewed.
- Returns
str