Skip to main content

A pytest plugin for colorful print statements

Project description

pytest-crayons

A pytest plugin for colorful print statements.

Installation

pip install pytest-crayons

Usage

Include a color fixture in the param list of a test. Then use it instead of print.

def test_something(blue):
    ... # some code
    blue("a print statement, that shows up blue")
    ... # more test code

Available colors

  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan

Example with all colors:

def test_colors(red, green, yellow, blue, magenta, cyan):
    print("") # for the newline
    red("this should be in red")
    green("this should be in green")
    yellow("this should be in yellow")
    blue("this should be in blue")
    magenta("this should be in magenta")
    cyan("this should be in cyan")

Shows up like this:

TODO: fill in this with a screen shot -->

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-crayons-0.0.1.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

pytest_crayons-0.0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page