PR #10482 made it so that if a fixture calls skip(), the skip location is shown as the test function, not the fixture. But it excluded xunit setup fixtures from this.
I suspect this was done to make a pre-existing test pass, however I think that the same reason for fixtures applies to xunit fixtures just as well, so we shouldn't exclude it.
Would also remove a string-hack that was used to implement this exclusion...
|
try: |
|
result = call_fixture_func(fixturefunc, request, kwargs) |
|
except TEST_OUTCOME as e: |
|
if isinstance(e, skip.Exception) and not fixturefunc.__name__.startswith( |
|
"xunit_setup" |
|
): |
|
e._use_item_location = True |
PR #10482 made it so that if a fixture calls
skip(), the skip location is shown as the test function, not the fixture. But it excluded xunit setup fixtures from this.I suspect this was done to make a pre-existing test pass, however I think that the same reason for fixtures applies to xunit fixtures just as well, so we shouldn't exclude it.
Would also remove a string-hack that was used to implement this exclusion...
pytest/src/_pytest/fixtures.py
Lines 1162 to 1168 in bf451d4