From 212c55218b1b7406643ba4fe7002702ff6cf2c04 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 16 Jan 2024 20:47:36 +0200 Subject: [PATCH] helpconfig: add invocation dir to debug output The current WD is not supposed to matter, the invocation dir is what should be relevant. But keep them both for debugging. --- src/_pytest/helpconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index 364bf4c42..91ea76997 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -109,10 +109,11 @@ def pytest_cmdline_parse() -> Generator[None, Config, Config]: debugfile = open(path, "w", encoding="utf-8") debugfile.write( "versions pytest-%s, " - "python-%s\ncwd=%s\nargs=%s\n\n" + "python-%s\ninvocation_dir=%s\ncwd=%s\nargs=%s\n\n" % ( pytest.__version__, ".".join(map(str, sys.version_info)), + config.invocation_params.dir, os.getcwd(), config.invocation_params.args, )