pytest-dev / pytest-dev/pytest-xdist

Make "-n 0" not error with "--dist" set

Open
#641 5 comments 2 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

I have this in my pytest.ini:

[pytest]
addopts = --numprocesses auto
          --dist loadscope

When I need to run with just one process, such as when I am just running a limited number of tests, using just -n 0 crashes:

$ pytest -n 0
...
platform darwin -- Python 3.9.1, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
...
ERROR: MISSING test execution (tx) nodes: please specify --tx

It would be great if -n 0 didn't need to worry about the dist mode.

This is similar to #549 which made --pdb imply --dist no alongside -n 0.

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 reproducing the reported pytest -n 0 failure with --dist loadscope configured in pytest.ini. Inspect the option handling for -n and --dist, then verify that forcing one process no longer requires distributed execution and that the existing distributed mode still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.