MCPcopy
hub / github.com/pytest-dev/pytest / test_merging_markers_deep

Method test_merging_markers_deep

testing/test_mark.py:541–559  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

539
540class TestFunctional:
541 def test_merging_markers_deep(self, pytester: Pytester) -> None:
542 # issue 199 - propagate markers into nested classes
543 p = pytester.makepyfile(
544 """
545 import pytest
546 class TestA(object):
547 pytestmark = pytest.mark.a
548 def test_b(self):
549 assert True
550 class TestC(object):
551 # this one didn't get marked
552 def test_d(self):
553 assert True
554 """
555 )
556 items, _rec = pytester.inline_genitems(p)
557 for item in items:
558 print(item, item.keywords)
559 assert [x for x in item.iter_markers() if x.name == "a"]
560
561 def test_mark_decorator_subclass_does_not_propagate_to_base(
562 self, pytester: Pytester

Callers

nothing calls this directly

Calls 3

iter_markersMethod · 0.80
makepyfileMethod · 0.45
inline_genitemsMethod · 0.45

Tested by

no test coverage detected