classification
Title: Python 3 unittest framework broken?
Type: crash Stage:
Components: Tests Versions: Python 3.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, bostjan.mejak
Priority: normal Keywords:

Created on 2013-07-03 10:29 by bostjan.mejak, last changed 2013-07-03 15:14 by amaury.forgeotdarc. This issue is now closed.

Messages (6)
msg192226 - (view) Author: Boštjan Mejak (bostjan.mejak) Date: 2013-07-03 10:29
I fired up the test suite runtests.py of wxPython Phoenix and I get this:

File "C:\Program Files\Python 3.3.2\lib\unittest\runner.py", line 63, in addSuccess
    self.stream.write('.')
TypeError: 'str' does not support the buffer interface

Can you confirm whether this is a bug in the unittest framework on the Python side or in the wxPython Phoenix source code side?
msg192229 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2013-07-03 11:02
wxPython tests override unittest.TextTestRunner:
    self.stream = unittest.runner._WritelnDecorator(BytesIO())

Using bytes is wrong. Output stream should be a text file.
msg192230 - (view) Author: Boštjan Mejak (bostjan.mejak) Date: 2013-07-03 11:37
So how exactly can this critical line of code (that you posted) be fixed to make running wxPython Phoenix tests work?
msg192231 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2013-07-03 11:58
This is an issue with wxPython, please report this issue to the wxPython team.
msg192242 - (view) Author: Boštjan Mejak (bostjan.mejak) Date: 2013-07-03 15:04
By "output stream should be a text file", have you ment the line should be

self.stream = unittest.runner._WriteInDecorator(StringIO())

Can you provide me a little hint so that I can make a patch for the wxPython team?
msg192244 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2013-07-03 15:14
Sorry, this bug tracker is for core Python only. Please discuss this issue on wxPython-dev mailing list.
History
Date User Action Args
2013-07-03 15:14:47amaury.forgeotdarcsetmessages: + msg192244
2013-07-03 15:04:18bostjan.mejaksetmessages: + msg192242
2013-07-03 11:58:19amaury.forgeotdarcsetmessages: + msg192231
2013-07-03 11:37:25bostjan.mejaksetmessages: + msg192230
2013-07-03 11:02:34amaury.forgeotdarcsetstatus: open -> closed

nosy: + amaury.forgeotdarc
messages: + msg192229

resolution: not a bug
2013-07-03 10:29:43bostjan.mejakcreate