diff --git a/CHANGELOG b/CHANGELOG index 57089eb..514f1b3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -1.9.dev +1.9 ------------------------- - changed LICENSE to MIT diff --git a/MANIFEST.in b/MANIFEST.in index e3ff469..cde85f9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,5 +2,6 @@ include CHANGELOG include LICENSE include README.txt include setup.py +include tox.ini graft testing prune .hg diff --git a/setup.py b/setup.py index fb5cadc..42ca34d 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="pytest-xdist", - version='1.9dev2', + version='1.9', description='py.test xdist plugin for distributed testing and loop-on-failing modes', long_description=open('README.txt').read(), license='MIT', @@ -13,7 +13,7 @@ setup( packages = ['xdist'], entry_points = {'pytest11': ['xdist = xdist.plugin'],}, zip_safe=False, - install_requires = ['execnet>=1.0.8', 'pytest>=2.2.1'], + install_requires = ['execnet>=1.1', 'pytest>=2.3.5'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', diff --git a/testing/test_dsession.py b/testing/test_dsession.py index ac686fb..3abb862 100644 --- a/testing/test_dsession.py +++ b/testing/test_dsession.py @@ -17,9 +17,16 @@ def run(item, node, excinfo=None): rep.node = node return rep +class MockGateway: + _count = 0 + def __init__(self): + self.id = str(self._count) + self._count += 1 + class MockNode: def __init__(self): self.sent = [] + self.gateway = MockGateway() def send_runtest(self, nodeid): self.sent.append(nodeid) @@ -183,22 +190,22 @@ def test_report_collection_diff_different(): from_collection = ['aaa', 'bbb', 'ccc', 'YYY'] to_collection = ['aZa', 'bbb', 'XXX', 'ccc'] error_message = ( - u'Different tests were collected between 1 and 2. The difference is:\n' - u'--- 1 \n' - u'\n' - u'+++ 2 \n' - u'\n' - u'@@ -1,4 +1,4 @@\n' - u'\n' - u'-aaa\n' - u'+aZa\n' - u' bbb\n' - u'+XXX\n' - u' ccc\n' - u'-YYY' + 'Different tests were collected between 1 and 2. The difference is:\n' + '--- 1\n' + '\n' + '+++ 2\n' + '\n' + '@@ -1,4 +1,4 @@\n' + '\n' + '-aaa\n' + '+aZa\n' + ' bbb\n' + '+XXX\n' + ' ccc\n' + '-YYY' ) try: report_collection_diff(from_collection, to_collection, 1, 2) except AssertionError as e: - assert unicode(e) == error_message + assert py.builtin._totext(e) == error_message diff --git a/tox.ini b/tox.ini index 2d10573..4b3c0fe 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,26 @@ [tox] -envlist=py26,py32,py33,py27,py25 +envlist=py26,py32,py33,py27,py26,py26-old,py33-old [testenv] changedir=testing -deps=pytest>=2.3.5 +deps=pytest>=2.4.2 commands= py.test --junitxml={envlogdir}/junit-{envname}.xml [] [testenv:py27] deps= - pytest + pytest>=2.4.2 pexpect +[testenv:py26-old] +deps= + pytest==2.3.5 + pexpect + +[testenv:py33-old] +basepython = python3.3 +deps= + pytest==2.3.5 + [pytest] addopts = -rsfxX ;; hello diff --git a/xdist/__init__.py b/xdist/__init__.py index 74ead2d..4f3014a 100644 --- a/xdist/__init__.py +++ b/xdist/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '1.9dev2' +__version__ = '1.9' diff --git a/xdist/dsession.py b/xdist/dsession.py index e6ca9c8..61940cf 100644 --- a/xdist/dsession.py +++ b/xdist/dsession.py @@ -177,13 +177,13 @@ def report_collection_diff(from_collection, to_collection, from_id, to_id): fromfile=from_id, tofile=to_id, ) - error_message = ( - u'Different tests were collected between {from_id} and {to_id}. ' - u'The difference is:\n' - u'{diff}' + error_message = py.builtin._totext( + 'Different tests were collected between {from_id} and {to_id}. ' + 'The difference is:\n' + '{diff}' ).format(from_id=from_id, to_id=to_id, diff='\n'.join(diff)) - - raise AssertionError(error_message) + msg = "\n".join([x.rstrip() for x in error_message.split("\n")]) + raise AssertionError(msg) class Interrupted(KeyboardInterrupt): diff --git a/xdist/remote.py b/xdist/remote.py index 9e64430..dbcc175 100644 --- a/xdist/remote.py +++ b/xdist/remote.py @@ -128,7 +128,7 @@ if __name__ == '__channelexec__': # python3.2 is not concurrent import safe, so let's play it safe # https://bitbucket.org/hpk42/pytest/issue/347/pytest-xdist-and-python-32 if sys.version_info[:2] == (3,2): - os.environ["PYTHONDONTWRITEBYTECODE"] = 1 + os.environ["PYTHONDONTWRITEBYTECODE"] = "1" slaveinput,args,option_dict = channel.receive() importpath = os.getcwd() sys.path.insert(0, importpath) # XXX only for remote situations