You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If test classes inherit from a base class, marking one of them as xfail marks the next classes also.
Here's a minimal example:
import pytest
class FooCase:
def test_foo(self):
assert True
class TestFoo(FooCase):
pass
@pytest.mark.xfail()
class TestBar(FooCase):
pass
class TestMoreFoo(FooCase):
pass
When running this, the 2nd test is XPASS (as expected), and the third one is XPASS too (unexpectedly):
In my project, I have a suite of functional tests, where the tests are the same, but setup fixtures are different. So the tests are defined in a base class, and there's a subclass for each kind of setup.
Sadly, I can't mark a subclass as xfail, because then classes which are collected later (even in different files!) get marked as xfail.
Any help is much appreciated.
If someone could point me to the part of the source code where the problem might be, I'll gladly look into it.
The text was updated successfully, but these errors were encountered:
If test classes inherit from a base class, marking one of them as
xfail
marks the next classes also.Here's a minimal example:
When running this, the 2nd test is XPASS (as expected), and the third one is XPASS too (unexpectedly):
Environment: Ubuntu 16.04, Python 3.5.2; pip freeze output:
In my project, I have a suite of functional tests, where the tests are the same, but setup fixtures are different. So the tests are defined in a base class, and there's a subclass for each kind of setup.
Sadly, I can't mark a subclass as
xfail
, because then classes which are collected later (even in different files!) get marked asxfail
.Any help is much appreciated.
If someone could point me to the part of the source code where the problem might be, I'll gladly look into it.
The text was updated successfully, but these errors were encountered: