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

Method test_keywords_at_node_level

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

Source from the content-addressed store, hash-verified

642 assert len(deselected_tests) == 2
643
644 def test_keywords_at_node_level(self, pytester: Pytester) -> None:
645 pytester.makepyfile(
646 """
647 import pytest
648 @pytest.fixture(scope="session", autouse=True)
649 def some(request):
650 request.keywords["hello"] = 42
651 assert "world" not in request.keywords
652
653 @pytest.fixture(scope="function", autouse=True)
654 def funcsetup(request):
655 assert "world" in request.keywords
656 assert "hello" in request.keywords
657
658 @pytest.mark.world
659 def test_function():
660 pass
661 """
662 )
663 reprec = pytester.inline_run()
664 reprec.assertoutcome(passed=1)
665
666 def test_keyword_added_for_session(self, pytester: Pytester) -> None:
667 pytester.makeconftest(

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected