Giter Club home page Giter Club logo

Comments (2)

mtreinish avatar mtreinish commented on August 17, 2024

I'm not sure if there is anything we can do here in the stestr for this case. I was able to reproduce this in tox, and I added some print statements to stestr to find why the color was being printed. The underlying issue is when we call the curses module from stdlib to setup the colors at https://github.com/mtreinish/stestr/blob/master/stestr/colorizer.py#L71 it raises an error:

setupterm: could not find terminfo database

Which probably means that tox is not passing through $TERM from your terminal to the commands it's running. This is preventing the color from being set by stestr when it's writing to stdout and it falls back to not using color.

As for the color being enabled by default. I feel like this is one of those places where different people will have different preferences. Which is why it's an option in the user config file, so if you prefer to have color on by default (it will still fallback if it can't use it) you can just set that in your user config file:
https://stestr.readthedocs.io/en/latest/MANUAL.html#user-config-files

from stestr.

mtreinish avatar mtreinish commented on August 17, 2024

Yeah, I just confirmed that this can work with tox. You just need to add passenv=TERM in the testenv in your tox.ini (or set TOX_TESTENV_PASSENV=TERM in your env when you run tox), Otherwise tox will not pass through the $TERM env variable and the curses module won't be able to figure out what terminal is in use.

I'm going to mark this is as closed because I don't see anything we can do to fix this from stestr itself. Feel free to re-open if I'm missing something.

from stestr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.