November 21, 2021

Combine Coverage for Different Python Versions

Is it enough to run code coverage for a single Python version? Probably, but not necessarily. Especially when you still need to support Python 2.7 (sigh), there could be quite some different code paths for Python 2 and Python 3. A simple example… try: import Queue # Python 2 except ImportError: import queue as Queue # Python 3 But also the different Python 3 versions may require that you not only test your code for each interpreter, but also you need to assess code coverage for the different versions, and certainly you want to make sure you got all paths covered....

June 11, 2021

How to Bring Color Back Into tox4 and pytest

When I first tried the pre-release of the upcoming tox rewrite, I noticed tox itself has funky new colors - which I like a lot… But what happened with the green dots for pytest'soutput? You may recall, running the old tox or pytest directly, the dots would be green… why has this changed Honestly, I am not 100% sure. But I know how to get the colors back. All you need to do is changing this line commands = pytest {posargs} in your tox....