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

Function test_mark_expressions_no_smear

testing/test_mark.py:1017–1049  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1015
1016
1017def test_mark_expressions_no_smear(pytester: Pytester) -> None:
1018 pytester.makepyfile(
1019 """
1020 import pytest
1021
1022 class BaseTests(object):
1023 def test_something(self):
1024 pass
1025
1026 @pytest.mark.FOO
1027 class TestFooClass(BaseTests):
1028 pass
1029
1030 @pytest.mark.BAR
1031 class TestBarClass(BaseTests):
1032 pass
1033 """
1034 )
1035
1036 reprec = pytester.inline_run("-m", "FOO")
1037 passed, skipped, failed = reprec.countoutcomes()
1038 dlist = reprec.getcalls("pytest_deselected")
1039 assert passed == 1
1040 assert skipped == failed == 0
1041 deselected_tests = dlist[0].items
1042 assert len(deselected_tests) == 1
1043
1044 # todo: fixed
1045 # keywords smear - expected behaviour
1046 # reprec_keywords = pytester.inline_run("-k", "FOO")
1047 # passed_k, skipped_k, failed_k = reprec_keywords.countoutcomes()
1048 # assert passed_k == 2
1049 # assert skipped_k == failed_k == 0
1050
1051
1052def test_addmarker_order(pytester) -> None:

Callers

nothing calls this directly

Calls 4

countoutcomesMethod · 0.80
getcallsMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected