Skip to content

Add a deselected parameter to assert_outcomes() #9113

@okken

Description

@okken

What's the problem this feature will solve?

I'd like to be able to use pytester.RunResult.assert_outcomes() to check deselected count.

Describe the solution you'd like

Add a deselected parameter to pytester.RunResult.assert_outcomes()

Plugins that use pytest_collection_modifyitems to change the items and add change the deselected items need to be tested. Using assert_outcomes() to check the deselected count would be helpful.

Alternative Solutions

Use parseoutcomes() instead of assert_outcomes(). parseoutcomes() returns a dictionary that includes deselected, if there are any.
However, if we have a series of tests, some that care about deselected, and some that don't, then we may have some tests using assert_outcomes() and some using parseoutcomes(), which is slightly annoying.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions