Skip to content

Double pytest.skip leads to failure #13537

Open
@ego-thales

Description

@ego-thales

Hello everyone.

I think the following is a bug.

@pytest.fixture
def fixA():
    yield
    pytest.skip(reason="A")

@pytest.fixture
def fixB():
    yield
    pytest.skip(reason="B")

def test_skip(fixA, fixB):  # FAILS
    assert True

Gives the following error report (removed tracebacks).

____________________________ ERROR at teardown of test_skip _____________________________
  + Exception Group Traceback (most recent call last):
  | <traceback>
  | BaseExceptionGroup: errors while tearing down <Function test_skip> (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | <traceback>
    | Skipped: A
    +---------------- 2 ----------------
    | <traceback>
    | Skipped: B
    +------------------------------------

Maybe pytest checks for the error raised being of the type of skips, and thus here it bugs because it's an ExceptionGroup and not a skip type? I'm just very wildly guessing, I don't know the internals of pytest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: tracebacksrelated to displaying and handling of tracebackstype: bugproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previously

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions