PyCharm Unit test fails

Answered

After creating a simple test case I received the following message:

Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py", line 35, in <module>
main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
TypeError: __init__() got an unexpected keyword argument 'buffer'

 

PyCharm 2017.2.3
Build #PY-172.3968.37, built on September 1, 2017
Licensed to glauco scheffel
Subscription is active until October 18, 2018
For educational use only.
JRE: 1.8.0_152-release-915-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

 

 

0
6 comments

Please try to reinstall PyCharm from scratch. Looks like "helpers" folder is semi-updated for some reason. Please let me know if the problem remains.

0
Avatar
Permanently deleted user

I've got the same problem.  I deleted pycharm from applications, reinstalled and no luck

0

Same issue here on a fresh install of PyCharm






 

0
Avatar
Permanently deleted user

I have the same error for PyCharm 2017.3.3, using Python 2_6_6_64, I think a non-backwards compatible argument "buffer" was added to the helpers at some point, breaking old Python versions. PyCharm claims to support 2.4 and later, some Linux distros, like the one at my Web hotel, still use 2.6.

 

Testing started at 11:08 ...
C:\programmering\Python\2_6_6_64\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pycharm\_jb_unittest_runner.py" --path C:/programmering/Jumpgate/cgi-bin/BestHaul.py
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pycharm\_jb_unittest_runner.py", line 35, in <module>
main(argv=args, module=None, testRunner=unittestpy.TeamcityTestRunner, buffer=not JB_DISABLE_BUFFERING)
TypeError: __init__() got an unexpected keyword argument 'buffer'
Launching unittests with arguments python -m unittest discover -s C:/programmering/Jumpgate/cgi-bin -p BestHaul.py -t C:\programmering\Jumpgate\cgi-bin in C:\programmering\Jumpgate\cgi-bin

 

From the Python 2.7 unittest.main docs:

 

Changed in version 2.7: The exitverbosityfailfastcatchbreak and buffer parameters were added.

 

So PyCharm unittest support is now only compatible with 2.7 and forward it seems.

0
Avatar
Permanently deleted user

This is broken from 2017.3.1, revertting to 2016.3.2 made unittest.main work again.

 

> Please try to reinstall PyCharm from scratch. Looks like "helpers" folder is semi-updated for some reason. Please let me know if the problem remains.Please try to reinstall PyCharm from scratch. Looks like "helpers" folder is semi-updated for some reason. Please let me know if the problem remains.

 

Mmmm.. maybe he should update his BIOS too, and try installing Windows 8? If you read the error message carefully, and then the code for Python 2.6.6 unittest.main, comparing with the documentation for 2.7, this doesn't really seem to be a semi-update of the local folder, but a semi-update of the source code.

 

I use the Community Edition, so I can't complain really, I use it for free, but at least there is a workaround if you still have your 2016.3.2 installer saved. Not sure how to find that on the PyCharm site though.

 

And by the way, thanks for an overall very nice, free for some, Python environment!

 

And I wouldn't mind if you said PyCharm 2018 will only support Python 2.7, leaving older versions with 2016.3.2, but then I wouldn't want these auto update messages.

0

Thank you for the feedback. Please follow PY-26042, I reproduced the problem and reopened the ticket. I am sorry it took so long.

0

Please sign in to leave a comment.