Skip to content

Commit ccd395f

Browse files
authored
Merge pull request pytest-dev#1659 from RonnyPfannschmidt/failtest-586
xfailing test for pytest-dev#568
2 parents 44695ae + 76756c0 commit ccd395f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

testing/test_mark.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,32 @@ def test_bar(self): pass
418418
items, rec = testdir.inline_genitems(p)
419419
self.assert_markers(items, test_foo=('a', 'b'), test_bar=('a',))
420420

421+
422+
@pytest.mark.issue568
423+
@pytest.mark.xfail(reason="markers smear on methods of base classes")
424+
def test_mark_should_not_pass_to_siebling_class(self, testdir):
425+
p = testdir.makepyfile("""
426+
import pytest
427+
428+
class TestBase:
429+
def test_foo(self):
430+
pass
431+
432+
@pytest.mark.b
433+
class TestSub(TestBase):
434+
pass
435+
436+
437+
class TestOtherSub(TestBase):
438+
pass
439+
440+
""")
441+
items, rec = testdir.inline_genitems(p)
442+
base_item, sub_item, sub_item_other = items
443+
assert not hasattr(base_item.obj, 'b')
444+
assert not hasattr(sub_item_other.obj, 'b')
445+
446+
421447
def test_mark_decorator_baseclasses_merged(self, testdir):
422448
p = testdir.makepyfile("""
423449
import pytest

0 commit comments

Comments
 (0)