Skip to content

Mark autouse fixtures in --setup-show (and friends) and --fixtures-per-test #14920

Open

Description

@The-Compiler

In my pytest trainings, people often use --setup-show and/or --fixtures-per-test and then are surprised that they see fixtures they did not specify as arguments. Those are typically autouse fixtures which are provided by plugins, which I have installed for later course chapters.

I think it would help if those commands would show those fixtures as something like [autouse], and/or dim them in the output. What do people think?

Activity

  1. added
    topic: reportingrelated to terminal output and user-facing messages and errors
    topic: fixturesanything involving fixtures directly or indirectly
    on Aug 21, 2026
  2. seanxuu commented on Aug 26, 2026

    @seanxuu

    I’d like to work on this issue.

    I plan to update the reporting for --setup-show and --fixtures-per-test so autouse fixtures are clearly marked, while preserving the current output for explicitly requested fixtures. I’ll add focused regression tests covering autouse fixtures at the relevant scopes and verify the existing test suite.

    Please let me know if this direction fits pytest.

  3. 0x4B-traveler commented on Aug 31, 2026

    @0x4B-traveler

    I would like to investigate this issue and propose a focused change with tests.

    My initial plan is to update the fixture reporting for both --setup-show and --fixtures-per-test, marking autouse fixtures clearly while preserving the current output structure. Is this direction still welcome?

    I will first prepare the tests locally and wait for maintainer feedback before opening a pull request.

  4. 0x4B-traveler commented on Aug 31, 2026

    @0x4B-traveler

    I noticed that seanxuu mentioned working on this issue earlier.

    I have prepared a local implementation and focused regression tests for marking autouse fixtures as [autouse] in both reporting modes.

    Before opening a PR, would it be useful for me to share this approach or coordinate with seanxuu to avoid duplicated work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: fixturesanything involving fixtures directly or indirectlytopic: reportingrelated to terminal output and user-facing messages and errors

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions