pytest-dev / pytest-dev/pytest-xdist

Help need with pytest_sessionstart

Open
#416 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
287
Avg merge
9h 30m
Merged PRs (30d)
2

Description

Please forgive me I am new to Python and Pytest and am already having a hard time understanding some functionality. I would like to distribute my tests across my selenium grid nodes. Prior to attempting to use this package I had a conftest file containing a pytest_sessionstart hook which would run once prior to all tests. The tests wouldnt start running until it was finished, this is the behavior I'm looking for. But when I attempt to use the xdist package its being run multiple times. Not sure if its once per test or worker. I want it to run once before distributing tests across the nodes. Can anyone help explain this to me in really simple terms? Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the conftest.py pytest_sessionstart hook and pytest-xdist's worker lifecycle, focusing on when the hook runs relative to test distribution across Selenium Grid nodes. Done means clearly explaining the current behavior and confirming whether a single pre-distribution run is supported or requires a scoped change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.