pytest-dev / pytest-dev/pytest-xdist

Question: Is it possible to create new subprocess for every test?

Open
#363 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,
I use -d --tx 2*popen//python=python3.7 to try to run my tests in subprocesses. However, it looks like the subprocess is reused between tests. I want each test to run in a fresh subprocess because I suspect that there are some memory leaking between tests. I tried using --forked but it had problem finding dependencies. Is there some flag I could pass to restart subprocess after each test?

Thank you,
Kittipat

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 by reading the xdist documentation and the entry points for -d, --tx, and --forked to understand subprocess lifetime and dependency handling. The issue is done when the project can clearly state whether a fresh subprocess per test is supported and, if not, define an accepted implementation or documentation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.