Skip to content

fixtures: change FixtureDef.cached_result[2] from exception triplet to exception #11208

@bluetech

Description

@bluetech

I propose changing the type of the 3rd item of FixtureDef.cached_result (which indicates a cached exception outcome of the fixture) from a sys.exc_info style triplet to just the exception instance.

The sys.exc_info exception triplet format is legacy from Python 2 and just complicates things nowadays.

While cached_result is not documented and is a private API, from 680 plugins I have checked out locally, 15 access it. However, none of them care about the type of cached_result[2], except for pytest-yield plugin, but it's already broken in recent pytests and only supports pytest<=4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: fixturesanything involving fixtures directly or indirectlytype: 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