12

Since a few days my pycharm debug console is systematically polluted by teamcity infos, e.g. when i want to print out a variable value, the following will be displayed:

>>> df
##teamcity[testStdOut timestamp='2017-11-02T15:55:00.670' flowId='test_pricing_36_weight_provider.TestPricing36WeightProvider.test_add_weights' locati...

Any hint how to deactivate this teamcity thing ?

register
  • 801
  • 1
  • 8
  • 15

2 Answers2

12

This is a PyCharm/IntelliJ bug.

PyCharm replaces stdout with its own object. They do a bunch of screwing around with objects that get printed, resulting in:

  • some object are not printed to the prompt
  • some programs cannot be run if they expect stdout to be a file object and not a StringIO.

This is a long standing bug with PyCharm - there's really no excuse for it in a piece of software with a $500/yr license fee. Being able to debug my program in my IDE out of the box is way up there in my list of requirements.

The work around they recommend is to set: JB_DISABLE_BUFFERING=1 ... which you can do for all unit tests.

See: no output in console for unittests in pycharm 2017

zahypeti
  • 183
  • 1
  • 8
user48956
  • 14,850
  • 19
  • 93
  • 154
0

Any chance you've installed a teamcity test runner or debugger of some kind in your pip requirements? The ##teamcity bit is a service message used to report output to a TeamCity build log.

Check this for more info about TC service messages: https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity

bluescores
  • 4,437
  • 1
  • 20
  • 34