@@ -207,7 +207,7 @@ def pytest_exception_interact(node, call, report):
207207 send_execution_message (
208208 os .fsdecode (cwd ),
209209 "success" ,
210- collected_test if collected_test else None ,
210+ collected_test or None ,
211211 )
212212
213213
@@ -331,7 +331,7 @@ def pytest_report_teststatus(report, config): # noqa: ARG001
331331 send_execution_message (
332332 os .fsdecode (cwd ),
333333 "success" ,
334- collected_test if collected_test else None ,
334+ collected_test or None ,
335335 )
336336 yield
337337
@@ -365,7 +365,7 @@ def pytest_runtest_protocol(item, nextitem): # noqa: ARG001
365365 send_execution_message (
366366 os .fsdecode (cwd ),
367367 "success" ,
368- collected_test if collected_test else None ,
368+ collected_test or None ,
369369 )
370370 yield
371371
@@ -852,10 +852,7 @@ def create_session_node(session: pytest.Session) -> TestNode:
852852 session -- the pytest session.
853853 """
854854 # Use PROJECT_ROOT_PATH if set (project-based testing), otherwise use session path (legacy)
855- if PROJECT_ROOT_PATH :
856- node_path = pathlib .Path (PROJECT_ROOT_PATH )
857- else :
858- node_path = get_node_path (session )
855+ node_path = pathlib .Path (PROJECT_ROOT_PATH ) if PROJECT_ROOT_PATH else get_node_path (session )
859856 return {
860857 "name" : node_path .name ,
861858 "path" : node_path ,
@@ -1047,7 +1044,7 @@ def get_node_path(
10471044 except Exception as e :
10481045 raise VSCodePytestError (
10491046 f"Error occurred while calculating symlink equivalent from node path: { e } "
1050- f"\n SYMLINK_PATH: { SYMLINK_PATH } , \n node path: { node_path } , \n cwd: { _CACHED_CWD if _CACHED_CWD else pathlib .Path .cwd ()} "
1047+ f"\n SYMLINK_PATH: { SYMLINK_PATH } , \n node path: { node_path } , \n cwd: { _CACHED_CWD or pathlib .Path .cwd ()} "
10511048 ) from e
10521049 else :
10531050 result = node_path
0 commit comments