https://pantsbuild.org/ logo
#general
Title
# general
h

high-yak-85899

01/31/2022, 7:01 PM
Does pants do something special to render terminal output with color? I'm hooking unit test execution into our change submission process and tests are running happily as I'd expect, but the stdout/stderr I'm able to print to the screen is missing its color. We didn't have this problem with our original hook that calls pytest.
h

hundreds-father-404

01/31/2022, 7:04 PM
Does it still happen if you use
./pants --colors test
? I wonder if our detection of whether to use colors is broken for you
h

high-yak-85899

01/31/2022, 7:07 PM
Nice! It does.
It's easy enough to add and we're going to be changing our code processes not too long in the future so this is definitely fine for now.
For awareness, we did have to specifically tell pytest to print with colors as well. I just hadn't seen that option with pants when looking around.
And it was so awesome to find the junit xml generation stuff! I've had multiple times where I come across something I need and then been pleasantly surprised to find a docs section that explains how to do exactly what I need.
❤️ 3
h

hundreds-father-404

01/31/2022, 7:44 PM
cool. you can permenantely set it in `pants.toml`:
Copy code
[GLOBAL]
colors = true
2 Views