Skip to content
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

HINT: How to provide coloring in demo with failing tests in docs #270

Closed
pytestbot opened this issue Mar 9, 2013 · 7 comments
Closed

HINT: How to provide coloring in demo with failing tests in docs #270

pytestbot opened this issue Mar 9, 2013 · 7 comments
Labels
type: docs documentation improvement, missing or needing clarification type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: jenisys, GitHub: jenisys


CONTEXT: docs

On page reportingdemo you write that you are working on the issue of providing coloring information. I had a similar problem with sphinx and solved it by using:

  • sphinxcontrib-programoutput
  • sphinxcontrib-ansi

I basically run the command (with ANSI mode enabled) while generating the docs.
This will capture the ANSI coloring escape sequences and convert it into HTML colors while generated HTML docs.

DOCUMENTATION EXAMPLE (of colored output):
tutorial01.html#run-the-feature-test
Look at my github project for the details (if this solution would be of interest for you).


@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


Wow, looks good. Ronny, are you up for integrating this into regendoc and pytest's sphinx/tox config?

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


there was no sane way to integrate that into regendoc when we last checked,
it would be either rerun all examples on documentation generation (in which case we wouldnt need regendoc) or the rather painfull general mess of having special escape codes in the documentation

@pytestbot pytestbot added the type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature label Jun 15, 2015
@pfctdayelise pfctdayelise added the type: docs documentation improvement, missing or needing clarification label Jul 25, 2015
@RonnyPfannschmidt
Copy link
Member

Closing as duplicate

@nicoddemus
Copy link
Member

Do you have the id of the duplicate Ronny? It would be interesting to keep it as a reference

@nicoddemus
Copy link
Member

I didn't know about sphinxcontrib-programoutput and sphinxcontrib-ansi, looks interesting.

It seems like it could be used, but I think it would have to replace regendoc, and we would loose the ability of writing inline examples. Alternatively, it would be possible to make regendoc a sphinx extension? (No idea how hard/feasible that is)

@RonnyPfannschmidt
Copy link
Member

#62

@nicoddemus
Copy link
Member

Thanks! 😄

fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
These 2 options allow you to pass in regular expressions that determine
whether files/directories are included or excluded in the recursive file
search.

Fixes pytest-dev#270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs documentation improvement, missing or needing clarification type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

4 participants