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
Post a Comment