Skip to content

Documentation error in Getting Started, re. grouping tests in classes #7646

@bobobox

Description

@bobobox

In the "Getting Started" document, in section "Group multiple tests in a class" (https://github.com/pytest-dev/pytest/blob/master/doc/en/getting-started.rst#group-multiple-tests-in-a-class), the document states:

Something to be aware of when grouping tests inside classes is that each test has a unique instance of the class.
Having each test share the same class instance would be very detrimental to test isolation and would promote poor test practices.
This is outlined below:

However, in what is shown below, both tests are demonstrated to share the same instance of the class, at 0xdeadbeef.

This seems to demonstrate the opposite of what is stated (that the instances are not the same).

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: help wanteddevelopers would like help from experts on this topictype: docsdocumentation improvement, missing or needing clarificationtype: infrastructureimprovement to development/releases/CI structure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions