-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Examples on Pytest.org should be in color #4430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
the outputs are scm tracked atm - so having/storing the output currently is potentially problematic we ought to take a look at a solution |
I wonder if we could make a custom highlighter to ~mostly get this working nicely |
About the landing page, I agree that's probably a good idea to have that in color. A quick solution is to change that output in the landing page to a picture. What do you folks think? |
I might hack on writing a pygments-pytest (pytest-pygments?) -- don't hold your breath though 😆 |
That would be an honorable endeavor, I don't doubt! 😁 Meanwhile a picture in the landing page might fit the bill hehehe |
ooh! this doesn't actually look that difficult to get ~something going -- it's going to inevitably drift from pytest but I figure it'll be better than nothing. I'm inspired -- I might hack on this on stream tonight 😆 Will probably use @chriskuehl's excellent |
I mostly got it working! https://github.com/asottile/pygments-pytest (hard to tell from the README -- I'll make it more obvious soon!) I need to polish up the README, write some tests, and handle a few edgecases and/or make pytest's output more consistent in a few cases |
@asottile well done, it looks way better than my original approach from 2012 which failed |
im also totally for making output more consistent |
Closed by #4456 🎉 |
This was one of the most fun things I've done in a while btw, thanks for the idea! |
Uh oh!
There was an error while loading. Please reload this page.
I write all my tests in unittest (I like classes and disagree with some of pytest's design decisions, like #3834) but I always install pytest on every box I use. Why? Colors.
Anyone who's been forced to
python -m unittest
knows how illegible it is without the red/green headers and highlights. I go out of my way to keep compatibility with both unittest and pytest (e.g., noself.subTest()
) just to get color output. New users install pytest for theassert
, but they stay for the colors.I'd suggest it's uniquely important that the giant, above-the-fold example output on the pytest.org landing page not be in black-and-white. Colorizing other examples in the docs could also improve readability.
Sphinx has a contrib module for parsing ANSI color codes from pytest output that should work.
The text was updated successfully, but these errors were encountered: