From 2ea07f73a741345f420d3829a374946c56cc419e Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 6 May 2015 13:41:39 +0200 Subject: [PATCH] finalize 1.12 version, some more adaptation for pytest versions, streamlining tox.ini --- CHANGELOG | 2 +- setup.py | 2 +- testing/test_slavemanage.py | 6 ++++-- tox.ini | 2 +- xdist/__init__.py | 2 +- xdist/plugin.py | 6 +++++- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6093ca2..456775f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -1.12.dev +1.12 ------------------------- - fix issue594: properly report errors when the test collection diff --git a/setup.py b/setup.py index 26bb42e..5d49246 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="pytest-xdist", - version='1.11', + version='1.12', description='py.test xdist plugin for distributed testing and loop-on-failing modes', long_description=open('README.txt').read(), license='MIT', diff --git a/testing/test_slavemanage.py b/testing/test_slavemanage.py index bd14405..d39a470 100644 --- a/testing/test_slavemanage.py +++ b/testing/test_slavemanage.py @@ -2,13 +2,15 @@ import py import pytest import execnet from _pytest.pytester import HookRecorder -from xdist import slavemanage +from xdist import slavemanage, newhooks from xdist.slavemanage import HostRSync, NodeManager -pytest_plugins = "pytester", +pytest_plugins = "pytester" def pytest_funcarg__hookrecorder(request, config): hookrecorder = HookRecorder(config.pluginmanager) + if hasattr(hookrecorder, "start_recording"): + hookrecorder.start_recording(newhooks) request.addfinalizer(hookrecorder.finish_recording) return hookrecorder diff --git a/tox.ini b/tox.ini index 44b8832..8f7dece 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py26,py33,py34,py27,py27-pexpect,py33-pexpect,py26,py26-old,py33-old,flakes +envlist=py26,py33,py34,py27,py27-pexpect,py33-pexpect,py26-old,py33-old,flakes [testenv] changedir=testing diff --git a/xdist/__init__.py b/xdist/__init__.py index 0606670..63c50fa 100644 --- a/xdist/__init__.py +++ b/xdist/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '1.11' +__version__ = '1.12' diff --git a/xdist/plugin.py b/xdist/plugin.py index 084353c..2fe5557 100644 --- a/xdist/plugin.py +++ b/xdist/plugin.py @@ -45,7 +45,11 @@ def pytest_addoption(parser): # ------------------------------------------------------------------------- def pytest_addhooks(pluginmanager): from xdist import newhooks - pluginmanager.addhooks(newhooks) + # avoid warnings with pytest-2.8 + method = getattr(pluginmanager, "add_hookspecs", None) + if method is None: + method = pluginmanager.addhooks + method(newhooks) # ------------------------------------------------------------------------- # distributed testing initialization