Author: Ronan Lamy <[email protected]>
Branch: pytest-2.9.2
Changeset: r88400:2375f918f240
Date: 2016-11-15 23:38 +0000
http://bitbucket.org/pypy/pypy/changeset/2375f918f240/

Log:    Don't use deprecated __multicall__

diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -159,7 +159,8 @@
         return space
 
 
-def pytest_runtest_setup(__multicall__, item):
[email protected](tryfirst=True)
+def pytest_runtest_setup(item):
     if isinstance(item, py.test.collect.Function):
         appclass = item.getparent(py.test.Class)
         if appclass is not None:
@@ -172,8 +173,6 @@
                 appclass.obj.space = LazyObjSpaceGetter()
             appclass.obj.runappdirect = option.runappdirect
 
-    __multicall__.execute()
-
 
 def pytest_ignore_collect(path):
     return path.check(link=1)
diff --git a/rpython/conftest.py b/rpython/conftest.py
--- a/rpython/conftest.py
+++ b/rpython/conftest.py
@@ -45,16 +45,6 @@
            help="show the dependencies that have been constructed from a 
trace")
 
 
-def pytest_pycollect_makeitem(__multicall__,collector, name, obj):
-    res = __multicall__.execute()
-    # work around pytest issue 251
-    import inspect
-    if res is None and inspect.isclass(obj) and \
-            collector.classnamefilter(name):
-        return py.test.collect.Class(name, parent=collector)
-    return res
-
-
 def pytest_addhooks(pluginmanager):
     pluginmanager.register(LeakFinder())
 
@@ -63,21 +53,21 @@
 
     So far, only used by the function lltype.malloc(flavor='raw').
     """
-    def pytest_runtest_setup(self, __multicall__, item):
-        __multicall__.execute()
+    @pytest.hookimpl(trylast=True)
+    def pytest_runtest_setup(self, item):
         if not isinstance(item, py.test.collect.Function):
             return
         if not getattr(item.obj, 'dont_track_allocations', False):
             leakfinder.start_tracking_allocations()
 
-    def pytest_runtest_call(self, __multicall__, item):
-        __multicall__.execute()
+    @pytest.hookimpl(trylast=True)
+    def pytest_runtest_call(self, item):
         if not isinstance(item, py.test.collect.Function):
             return
         item._success = True
 
-    def pytest_runtest_teardown(self, __multicall__, item):
-        __multicall__.execute()
+    @pytest.hookimpl(trylast=True)
+    def pytest_runtest_teardown(self, item):
         if not isinstance(item, py.test.collect.Function):
             return
         if (not getattr(item.obj, 'dont_track_allocations', False)
diff --git a/testrunner/test/conftest.py b/testrunner/test/conftest.py
--- a/testrunner/test/conftest.py
+++ b/testrunner/test/conftest.py
@@ -1,6 +1,8 @@
+import pytest
 
-def pytest_runtest_makereport(__multicall__, item):
-    report = __multicall__.execute()
[email protected](hookwrapper=True)
+def pytest_runtest_makereport(item):
+    report = yield
     if 'out' in item.funcargs:
         report.sections.append(('out', item.funcargs['out'].read()))
     return report
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to