fix issue25 --pdb and win32/python encodings cause a crash in certain situations.

The reason is not clear but avoiding a fresh copy of the terminal writer
helps, maybe because the underlying file object has some state?
This commit is contained in:
holger krekel 2011-03-07 13:17:07 +01:00
parent f8e3fe8fbf
commit 5470cadbff
4 changed files with 8 additions and 3 deletions

View File

@ -29,6 +29,8 @@ Changes between 2.0.1 and 2.0.2
of test ids that you can use to paste to the py.test commandline of test ids that you can use to paste to the py.test commandline
in order to execute a particular test. in order to execute a particular test.
- fix issue25 avoid reported problems with --pdb and python3.2/encodings output
- fix issue23 - tmpdir argument now works on Python3.2 and WindowsXP - fix issue23 - tmpdir argument now works on Python3.2 and WindowsXP
Starting with Python3.2 os.symlink may be supported. By requiring Starting with Python3.2 os.symlink may be supported. By requiring
a newer py lib version the py.path.local() implementation acknowledges a newer py lib version the py.path.local() implementation acknowledges

View File

@ -52,7 +52,10 @@ class PdbInvoke:
if "xfail" in rep.keywords: if "xfail" in rep.keywords:
return rep return rep
# we assume that the above execute() suspended capturing # we assume that the above execute() suspended capturing
tw = py.io.TerminalWriter() # XXX we re-use the TerminalReporter's terminalwriter
# because this seems to avoid some encoding related troubles
# for not completely clear reasons.
tw = item.config.pluginmanager.getplugin("terminalreporter")._tw
tw.line() tw.line()
tw.sep(">", "traceback") tw.sep(">", "traceback")
rep.toterminal(tw) rep.toterminal(tw)

View File

@ -1,7 +1,7 @@
""" """
unit and functional testing with Python. unit and functional testing with Python.
""" """
__version__ = '2.0.2.dev5' __version__ = '2.0.2.dev6'
__all__ = ['main'] __all__ = ['main']
from _pytest.core import main, UsageError, _preloadplugins from _pytest.core import main, UsageError, _preloadplugins

View File

@ -22,7 +22,7 @@ def main():
name='pytest', name='pytest',
description='py.test: simple powerful testing with Python', description='py.test: simple powerful testing with Python',
long_description = long_description, long_description = long_description,
version='2.0.2.dev5', version='2.0.2.dev6',
url='http://pytest.org', url='http://pytest.org',
license='MIT license', license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],