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

Allow using latex to colorize the markdown report #4

Closed
dhirschfeld opened this issue Sep 13, 2023 · 2 comments
Closed

Allow using latex to colorize the markdown report #4

dhirschfeld opened this issue Sep 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dhirschfeld
Copy link

filepath passed failed error skipped xfailed xpassed SUBTOTAL
$${\color[RGB]{153,0,26}\tt{examples/test\_error.py}}$$ $${\color[RGB]{153,0,26}\tt{2}}$$ $${\color[RGB]{153,0,26}\tt{2}}$$
$${\color[RGB]{153,0,26}\tt{examples/test\_failed.py}}$$ $${\color[RGB]{153,0,26}\tt{2}}$$ $${\color[RGB]{153,0,26}\tt{2}}$$
$${\color[RGB]{30,179,0}\tt{examples/test\_pass.py}}$$ $${\color[RGB]{30,179,0}\tt{2}}$$ $${\color[RGB]{30,179,0}\tt{2}}$$
$${\color[RGB]{255,221,51}\tt{examples/test\_skipped.py}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$
$${\color[RGB]{255,221,51}\tt{examples/test\_xfailed.py}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$
$${\color[RGB]{255,221,51}\tt{examples/test\_xpassed.py}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$
$${\color[RGB]{153,0,26}\tt{TOTAL}}$$ $${\color[RGB]{30,179,0}\tt{2}}$$ $${\color[RGB]{153,0,26}\tt{2}}$$ $${\color[RGB]{153,0,26}\tt{2}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$ $${\color[RGB]{255,221,51}\tt{2}}$$ $${\color[RGB]{153,0,26}\tt{12}}$$
@thombashi thombashi added the enhancement New feature or request label Oct 5, 2023
thombashi added a commit that referenced this issue Oct 8, 2023
@thombashi
Copy link
Owner

@dhirschfeld
Thank you for your suggestion.
pytest-md-report 0.5.0 added --md-report-flavor option.
With this option (--md-report-flavor gfm), you can render colorized markdown using latex.
Like the following:

filepath $$\textcolor{#23d18b}{\tt{passed}}$$ $$\textcolor{#f14c4c}{\tt{failed}}$$ $$\textcolor{#f14c4c}{\tt{error}}$$ $$\textcolor{#f5f543}{\tt{skipped}}$$ $$\textcolor{#f5f543}{\tt{xfailed}}$$ $$\textcolor{#f5f543}{\tt{xpassed}}$$ SUBTOTAL
$$\textcolor{#f14c4c}{\tt{test\_error.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$
$$\textcolor{#f14c4c}{\tt{test\_failed.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$
$$\textcolor{#23d18b}{\tt{test\_pass.py}}$$ $$\textcolor{#23d18b}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#23d18b}{\tt{2}}$$
$$\textcolor{#f5f543}{\tt{test\_skipped.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f5f543}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f5f543}{\tt{2}}$$
$$\textcolor{#f5f543}{\tt{test\_xfailed.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f5f543}{\tt{2}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f5f543}{\tt{2}}$$
$$\textcolor{#f5f543}{\tt{test\_xpassed.py}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#666666}{\tt{0}}$$ $$\textcolor{#f5f543}{\tt{2}}$$ $$\textcolor{#f5f543}{\tt{2}}$$
$$\textcolor{#f14c4c}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{2}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$ $$\textcolor{#f14c4c}{\tt{2}}$$ $$\textcolor{#f5f543}{\tt{2}}$$ $$\textcolor{#f5f543}{\tt{2}}$$ $$\textcolor{#f5f543}{\tt{2}}$$ $$\textcolor{#f14c4c}{\tt{12}}$$

@dhirschfeld
Copy link
Author

@thombashi - thanks for the very useful project, and thanks for implementing the suggestion! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants