remove all occurences of "__multicall__" on hook impls in pytest/*.
also simplify pytest_runtest_markereport hook in _pytest/skipping.py while touching the code anyway.
This commit is contained in:
@@ -525,12 +525,15 @@ class TestConftestCustomization:
|
||||
def test_customized_pymakeitem(self, testdir):
|
||||
b = testdir.mkdir("a").mkdir("b")
|
||||
b.join("conftest.py").write(py.code.Source("""
|
||||
def pytest_pycollect_makeitem(__multicall__):
|
||||
result = __multicall__.execute()
|
||||
if result:
|
||||
for func in result:
|
||||
func._some123 = "world"
|
||||
return result
|
||||
import pytest
|
||||
@pytest.mark.hookwrapper
|
||||
def pytest_pycollect_makeitem():
|
||||
outcome = yield
|
||||
if outcome.excinfo is None:
|
||||
result = outcome.result
|
||||
if result:
|
||||
for func in result:
|
||||
func._some123 = "world"
|
||||
"""))
|
||||
b.join("test_module.py").write(py.code.Source("""
|
||||
import pytest
|
||||
|
||||
@@ -509,11 +509,13 @@ class TestKeywordSelection:
|
||||
pass
|
||||
""")
|
||||
testdir.makepyfile(conftest="""
|
||||
def pytest_pycollect_makeitem(__multicall__, name):
|
||||
import pytest
|
||||
@pytest.mark.hookwrapper
|
||||
def pytest_pycollect_makeitem(name):
|
||||
outcome = yield
|
||||
if name == "TestClass":
|
||||
item = __multicall__.execute()
|
||||
item = outcome.get_result()
|
||||
item.extra_keyword_matches.add("xxx")
|
||||
return item
|
||||
""")
|
||||
reprec = testdir.inline_run(p.dirpath(), '-s', '-k', keyword)
|
||||
py.builtin.print_("keyword", repr(keyword))
|
||||
|
||||
Reference in New Issue
Block a user