Skip to content

Fixture scope documentation #538

@pytestbot

Description

@pytestbot

Originally reported by: Mark Stacey (BitBucket: Gudahtt, GitHub: Gudahtt)


The fixture documentation briefly mentions the possibility of a fixture with class scope in the beginning summary, but it isn't mentioned anywhere else in the document. I had to check the source code to see if this was possible.

Also, I didn't see any mention that the default scope was "function" - it was implied, but not explicit.

I think it would be helpful to include a full list of available scopes, and to explicitly say that function scope is default. Both of these things are included in the docstring for the fixture function in the source code:

#!python

:arg scope: the scope for which this fixture is shared, one of
                "function" (default), "class", "module", "session".

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: docsdocumentation improvement, missing or needing clarificationtype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions