You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytest_sessionfinish is a built-in pytest hook method that executes after all tests finish.
Called after whole test run finished, right before returning the exit status to the system.
pytest-xdist violates the intended usage of the function by calling the method while workers are still running, rather than "right before returning the exit status to the system". It does not run multiple times for each worker, so it appears something internal to pytest-xdist executes this before all workers are done.
If this is a desired outcome it would be beneficial to document it.
The text was updated successfully, but these errors were encountered:
I am having a similar issue, I want to access the session data and retrieve the failed tests using this in conftest
def pytest_sessionfinish(session, exitstatus):
if exitstatus == 1:
for sess in session.items:
if sess._test_failed_statuses["call"]:
payload["description"] += f"\n- {sess.nodeid}"
But when running with xdist I am getting this error :
line 162, in pytest_sessionfinish
for sess in session.items:
AttributeError: 'Session' object has no attribute 'items'
What is the work around to access the session data for all the tests.
pytest_sessionfinish
is a built-in pytest hook method that executes after all tests finish.pytest-xdist violates the intended usage of the function by calling the method while workers are still running, rather than "right before returning the exit status to the system". It does not run multiple times for each worker, so it appears something internal to pytest-xdist executes this before all workers are done.
If this is a desired outcome it would be beneficial to document it.
The text was updated successfully, but these errors were encountered: