pytest-dev / pytest-dev/pytest

request direct parameterisation of fixtures by tests

Open
#10,561 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This code works which I didn't expect. Request for this to be supported.

python 3.7.3, pytest 7.0.0

import pytest


@pytest.fixture
def c(d, e):
    return d + e


@pytest.mark.parametrize(argnames='d, e', argvalues=[(0, 2), (1, 3)])
def test_1(c, d, e):
    assert c == d + e

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

Reproduce the provided pytest 7.0.0 example first, then inspect pytest's fixture and parametrization entry points to determine the intended behavior. Done means direct fixture parameterization is explicitly supported and covered by a regression test for both parameter sets; the issue names no files or tests, so the implementation scope needs clarification.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.