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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pytest-crayons-0.0.1.tar.gz.

File metadata

  • Download URL: pytest-crayons-0.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for pytest-crayons-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2eb9705afe7b073e2226191ce0a831fd9af0883252239966f7e23509a5e1ff1d
MD5 dd28c1d2fcbb9a6510302db54024f4d2
BLAKE2b-256 f1c08947282d2b875bc989d9fa7e6b64d004796bc1f495f464df43dfabbe71b8

See more details on using hashes here.

File details

Details for the file pytest_crayons-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_crayons-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52bfc1e440a2d63ed3ab91203379b1ddcefad470fc97918c9f715989652b1d31
MD5 0f73967788521d27124d2bb374fe53ed
BLAKE2b-256 2d4287caf10daa278aa4872564beae01030abee6363123ecdf88cfb6c9cc48c5

See more details on using hashes here.

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