From b96d552dbdcabbdebc43ff8670cd3b3db75c7640 Mon Sep 17 00:00:00 2001 From: Daniel Grana Date: Thu, 27 Mar 2014 23:57:18 -0300 Subject: [PATCH 1/4] no need for im_func and it does not exists in python3 --- _pytest/unittest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/unittest.py b/_pytest/unittest.py index e6fefbd43..12c1cfd53 100644 --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -154,7 +154,7 @@ def pytest_runtest_protocol(item, __multicall__): if isinstance(item, TestCaseFunction): if 'twisted.trial.unittest' in sys.modules: ut = sys.modules['twisted.python.failure'] - Failure__init__ = ut.Failure.__init__.im_func + Failure__init__ = ut.Failure.__init__ check_testcase_implements_trial_reporter() def excstore(self, exc_value=None, exc_type=None, exc_tb=None, captureVars=None): From 0cb9d26d83f786f4665e1b0434d61302a5457c94 Mon Sep 17 00:00:00 2001 From: Daniel Grana Date: Fri, 28 Mar 2014 10:44:51 -0300 Subject: [PATCH 2/4] add py33-trial tox environment --- tox.ini | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index d960cd22b..7ef07329e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] distshare={homedir}/.tox/distshare -envlist=flakes,py26,py27,pypy,py27-pexpect,py33-pexpect,py27-nobyte,py32,py33,py27-xdist,py33-xdist,trial +envlist=flakes,py26,py27,pypy,py27-pexpect,py33-pexpect,py27-nobyte,py32,py33,py27-xdist,py33-xdist,py27-trial,py33-trial [testenv] changedir=testing @@ -61,12 +61,22 @@ commands= py.test -n3 -rfsxX \ --junitxml={envlogdir}/junit-{envname}.xml {posargs:testing} -[testenv:trial] +[testenv:py27-trial] changedir=. +basepython=python2.7 deps=twisted commands= py.test -rsxf \ --junitxml={envlogdir}/junit-{envname}.xml {posargs:testing/test_unittest.py} + +[testenv:py33-trial] +changedir=. +basepython=python3.3 +deps={[testenv:py27-trial]deps} +commands= + py.test -rsxf \ + --junitxml={envlogdir}/junit-{envname}.xml {posargs:testing/test_unittest.py} + [testenv:doctest] changedir=. commands=py.test --doctest-modules _pytest From 85d52481b1484e41f5aaea6dcbcc59f606c7afb0 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 28 Mar 2014 14:47:34 +0100 Subject: [PATCH 3/4] fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR. --- AUTHORS | 1 + CHANGELOG | 2 ++ 2 files changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 0254dbfdf..c6235fc64 100644 --- a/AUTHORS +++ b/AUTHORS @@ -40,3 +40,4 @@ Piotr Banaszkiewicz Jurko Gospodnetić Marc Schlaich Christopher Gilling +Daniel Grana diff --git a/CHANGELOG b/CHANGELOG index 42feb6dc2..0dfd17356 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,8 @@ NEXT (2.6) - merge PR123: improved integration with mock.patch decorator on tests. +- fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR. + 2.5.2 ----------------------------------- From e061ace099669e71d1f7e4073b6f7d5a1a9dcc2c Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 28 Mar 2014 14:51:00 +0100 Subject: [PATCH 4/4] fix toxenv spec for py33-pexpect, thanks Daniel Grana. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7ef07329e..d48ff874f 100644 --- a/tox.ini +++ b/tox.ini @@ -45,7 +45,7 @@ commands= [testenv:py33-pexpect] changedir=testing -basepython=python2.7 +basepython=python3.3 deps={[testenv:py27-pexpect]deps} commands= py.test -rfsxX test_pdb.py test_terminal.py test_unittest.py