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 ce1009166..7ebe9e866 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -26,11 +26,12 @@ NEXT (2.6) - fix issue412: messing with stdout/stderr FD-level streams is now captured without crashes. +- fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR. + - simplified internal capturing mechanism and made it more robust against tests or setups changing FD1/FD2, also better integrated now with pytest.pdb() in single tests. - 2.5.2 ----------------------------------- 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): diff --git a/tox.ini b/tox.ini index d960cd22b..d48ff874f 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 @@ -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 @@ -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