pytest-dev / pytest-dev/pytest

API Question: Configure pytest without running it

Open
#7,309 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: config type: enhancement type: refactoring
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

Hi pytest team,

I am developing the ipytest package, which allows you to run pytest inside the notebook. Recently a question regarding the pytest API came up: is there some API to configure pytest without running it? I browsed the API docs but couldn't find an easy way and just wanted to make sure I did not overlook something. This issue is not breaking and hence resolving it is more a nice to have.

The motivation: a user reported the issue, that pytest.mark.parametrize gives misleading error messages. The root cause for this behavior (see detailed description here) seems to be that the mark generator behaves differently when pytest is configured. For ipytest, the tests are all defined before pytest is run (and configured). Therefore the error message of the mark generator is a little bit tricky to parse.

Contributor guide

Open the contributing guide

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 pytest API documentation and the configuration lifecycle relevant to pytest.mark.parametrize. Read the linked ipytest issue 39 for the reported behavior, then determine whether a supported configuration-only entry point is needed. Done means a clear API decision and corresponding documentation or implementation scope.

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.