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:
holger krekel
2014-10-08 20:23:40 +02:00
parent c3d1986101
commit 5999368002
11 changed files with 138 additions and 135 deletions
+9 -6
View File
@@ -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
+5 -3
View File
@@ -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))