I have created unitests using import unittest. When I want to run a specific test and I put a breakpoint then go to the console and try to eval expressions there\'s no r
Looks like the official fix for this bug, PY-22505, is to add the new JB_DISABLE_BUFFERING
environment variable to your unit test configurations (no value required, per screenshot), but only for 2017.1.3 or greater.
This screenshot shows adding the env var for the Defaults config, so all new configs will inherit it. You could also add this individually to already-saved Run/Debug configurations:
With that env var in place, I can now:
inspect my runtime and get the printouts (note captureStandardOutput='true'
):
...
##teamcity[testStarted timestamp='...' captureStandardOutput='true' locationHint='python://test_distance.Foo.testMatchRatio_050' name='testMatchRatio_050' nodeId='3' parentNodeId='2']
import sys; print('Python %s on %s' % (sys.version, sys.platform))
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:39:47)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>>> print(self)
testMatchRatio_050 (test_distance.Foo)