diff --git a/src/_pytest/paths.py b/src/_pytest/paths.py new file mode 100644 index 000000000..7c0dc1ec1 --- /dev/null +++ b/src/_pytest/paths.py @@ -0,0 +1,13 @@ +from .compat import Path +from os.path import expanduser, expandvars, isabs + + +def resolve_from_str(input, root): + assert not isinstance(input, Path), "would break on py2" + root = Path(root) + input = expanduser(input) + input = expandvars(input) + if isabs(input): + return Path(input) + else: + return root.joinpath(input)