debugging - Pycharm unit test interactive debug command line doesn't work -


when debugging unit tests (through pycharm test runner), 1 can turn on interactive command line, (unlike when debugging regular scripts) commands entered don't produce output. matter of fact, appears stdout being captured somewhere, because stderr works expected:

>>> print "a" >>> import sys >>> sys.stderr.write("moof") moof >>> sys.stdout.write("moof") >>> sys.stderr.write("test") test 

is expected behavior? interactive debug console , awesome if behaved nice when debugging unit tests well.

this because test runner capturing stdout not stderr.

i use py.test captures both stdout , stderr see no output @ all. if want see output have pass -s flag py.test runner can done modifying run/debug configuration , adding flag options field. (run > edit configurations > defaults > python tests > py.test > add -s options field.)

>>> print 'a' >>> import sys >>> sys.stderr.write('moof') moof >>> sys.stdout.write('moof') moof >>> sys.stderr.write('test') test 

note: -s flag can equally used nose tests


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -