Skip to content

Commit 79bb94f

Browse files
authored
fix bug where session path is undefined (#21544)
fixes #21540
1 parent b1931a3 commit 79bb94f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pythonFiles/vscode_pytest/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,10 @@ def create_session_node(session: pytest.Session) -> TestNode:
399399
Keyword arguments:
400400
session -- the pytest session.
401401
"""
402+
session_path = session.path if session.path else pathlib.Path.cwd()
402403
return {
403404
"name": session.name,
404-
"path": session.path,
405+
"path": session_path,
405406
"type_": "folder",
406407
"children": [],
407408
"id_": os.fspath(session.path),

0 commit comments

Comments
 (0)