MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_merging_markers_deep

Method test_merging_markers_deep

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

Source from the content-addressed store, hash-verified

470
471class TestFunctional:
472 def test_merging_markers_deep(self, pytester: Pytester) -> None:
473 # issue 199 - propagate markers into nested classes
474 p = pytester.makepyfile(
475 """
476 import pytest
477 class TestA(object):
478 pytestmark = pytest.mark.a
479 def test_b(self):
480 assert True
481 class TestC(object):
482 # this one didn't get marked
483 def test_d(self):
484 assert True
485 """
486 )
487 items, rec = pytester.inline_genitems(p)
488 for item in items:
489 print(item, item.keywords)
490 assert [x for x in item.iter_markers() if x.name == "a"]
491
492 def test_mark_decorator_subclass_does_not_propagate_to_base(
493 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