-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
plugin: unittestrelated to the unittest integration builtin pluginrelated to the unittest integration builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
I just now updated an old application from pytest 7 to 8 and the following started failing:
# Using pytest 8.4.2
from unittest import TestCase, skipIf
import pytest
@skipIf(True, "reason")
class Foo(TestCase):
@pytest.fixture(autouse=True)
def something(self):
assert 0
def test_bar(self):
pass- Expected: The assert not being hit since all tests are skipped
- Actual: The assert is hit despite no tests being run.
I found that using pytest.mark.skipif instead of the unittest skipIf works around the issue. The context is that this is a Linux only test and skipped anywhere else, and the fixture also only works on Linux
Metadata
Metadata
Assignees
Labels
plugin: unittestrelated to the unittest integration builtin pluginrelated to the unittest integration builtin plugintype: bugproblem that needs to be addressedproblem that needs to be addressed