Skip to main content

A nyan-cat inspired test reporter for pytest

Project description

Nyan Pytest ๐Ÿฑโ€๐Ÿš€

A delightful nyan-cat inspired pytest plugin that displays test results with a colorful nyan cat animation and rainbow trail.

========================================================================โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ•ญโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฎ
======================================================================โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ•ญโ”ซ โ™ฅ * โ™ฅ * โ™ฅ *โ”ƒ โ•ฎ โ•ฎ
====================================================================โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ”ƒโ”ƒ* โ™ฅ * โ™ฅ * โ™ฅ โ”ƒ(^แดฅ^)
====================================================================โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆ-โ”ซ โ™ฅ * โ™ฅ * โ™ฅ *โ”ฃโ•ฏ
======================================================================โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ
========================================================================โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆ  โ•ฐโ”› โ•ฐโ”› โ•ฐโ”› โ•ฐโ”›

Tests: 42/50 โœ… 38 โŒ 3 โญ๏ธ 1

Nyan cat flying through your test results with a beautiful rainbow trail!

Python License

โœจ Features

  • ๐ŸŒˆ Animated rainbow trail that grows with test progress
  • ๐Ÿฑ Adorable nyan cat with paw animations
  • ๐Ÿ“Š Real-time test statistics (passed, failed, skipped)
  • ๐ŸŽจ Full color support with ANSI escape codes
  • ๐Ÿ–ฅ๏ธ Terminal compatibility for both interactive and non-interactive environments
  • โšก Performance optimized for smooth animations

๐Ÿš€ Installation

pip install nyan-pytest

For development:

git clone https://github.com/your-repo/nyan-pytest
cd nyan-pytest
make setup

๐ŸŽฎ Usage

Basic Usage

Run pytest with nyan cat alongside standard output:

pytest --nyan

Use only nyan cat (cleaner output):

pytest --nyan-only

Demo Mode

Want to see nyan cat in action? Try the simulation mode:

# Quick demo with 20 simulated tests
pytest --nyan-sim 20

# Epic demo with 100 tests
pytest --nyan-sim 100

# Fast animation demo
pytest --nyan-sim 30 --nyan-speed 2

# Moderate speed
pytest --nyan-sim 30 --nyan-speed 15

# Slow, relaxing animation
pytest --nyan-sim 30 --nyan-speed 50

Makefile Commands

This project includes a comprehensive Makefile for development:

# Show all available commands
make help

# Run tests with nyan cat
make test-nyan

# Quick demo
make demo

# Epic party mode! ๐ŸŽ‰
make party

# Performance benchmarking
make benchmark

# Development setup
make setup

๐ŸŽฏ Command Line Options

Option Description
--nyan Enable nyan cat reporter alongside default pytest output
--nyan-only Use only nyan cat reporter (no standard pytest output)
--nyan-sim N Simulate N tests to demo the animation
--nyan-speed N Animation speed (1=fastest, 6=default, 100=slowest)

๐ŸŽ›๏ธ Speed Guide

Speed Range Best For Description
1-3 Fast unit tests Quick visual feedback, minimal distraction
4-8 Regular development Good balance of visibility and speed (default: 6)
10-25 Watching tests run Comfortable viewing during test execution
30-60 Relaxed development Slow, enjoyable animation for longer test suites
70-100 Demos & presentations Very slow, perfect for showing off to colleagues!

๐ŸŽจ What You'll See

When running tests, you'll see:

โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ•ญโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฎ
โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ•ญโ”ซ โ™ฅ * โ™ฅ * โ™ฅ *โ”ƒ โ•ฎ โ•ฎ
โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ”ƒโ”ƒ* โ™ฅ * โ™ฅ * โ™ฅ โ”ƒ(^แดฅ^)
โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆ-โ”ซ โ™ฅ * โ™ฅ * โ™ฅ *โ”ฃโ•ฏ
โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ
โ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆโ‰ˆ  โ•ฐโ”› โ•ฐโ”› โ•ฐโ”› โ•ฐโ”›

Tests: 15/20 โœ… 12 โŒ 2 โญ๏ธ 1
  • ๐ŸŒˆ Rainbow trail (โ‰ˆ characters) grows as tests complete
  • ๐ŸŽญ Animated cat body with hearts (โ™ฅ) and stars (*)
  • ๐Ÿพ Moving paws that animate during test execution
  • ๐Ÿ“ˆ Live statistics showing progress and results

๐Ÿ› ๏ธ Development

Quick Start

# Clone and setup
git clone <repo-url>
cd nyan-pytest
make setup

# Run tests
make test-nyan

# Check code quality
make lint

# Try the demo
make demo

Available Make Commands

Command Description
make setup Install dev dependencies
make test-nyan Run tests with nyan output
make demo Demo with 20 simulated tests
make performance Run performance benchmarks
make lint Check code quality
make format Format code
make build Build package
make clean Clean build artifacts

๐ŸŽช Examples

Running Your Test Suite

# Standard pytest with nyan enhancement
pytest tests/ --nyan -v

# Clean nyan-only output
pytest tests/ --nyan-only

# Verbose mode with test details
pytest tests/ --nyan -v -s

Performance Testing

# Benchmark nyan vs standard reporter
make benchmark

# Time the plugin performance
make performance

Demo Modes

# Quick 10-test demo
make demo-fast

# Standard 20-test demo
make demo

# Longer 50-test demo
make demo-slow

# Epic 100-test party! ๐ŸŽ‰
make party

โšก Performance Impact

TL;DR: The delight factor far outweighs the modest performance cost!

Nyan cat adds visual joy to your testing workflow with minimal impact on development productivity. Benchmarks show the animation overhead is essentially constant (~2.3 seconds) regardless of test count:

Benchmark Results

Test Count Standard Nyan Cat Overhead % Slower
10 tests 0.18s 2.41s +2.23s +1225%
100 tests 1.26s 3.52s +2.27s +181%
1000 tests 11.97s 14.31s +2.33s +20%

Key Insights

๐ŸŽฏ Animation overhead is constant - The ~2.3 second cost doesn't scale with test count
๐Ÿ“ˆ Scales beautifully - Larger test suites see proportionally less impact
โšก Negligible in practice - 2-3 seconds is nothing compared to typical development workflows

When to Use Nyan Cat

โœ… Perfect for:

  • Development workflows - Makes test-watching enjoyable
  • Medium to large test suites - 20-180% overhead on 100-1000 tests
  • CI/CD pipelines - Minimal time vs overall build/deploy phases
  • Demo environments - Delights stakeholders and team members
  • Any project where developer happiness matters

โœ… Why the overhead is worth it:

  • Developer motivation - Transforms boring test runs into engaging experiences
  • Visual progress feedback - Clear, delightful indication of test execution
  • Team morale boost - Brings smiles to code reviews, standups, and demos
  • Context matters - 2.3s is negligible compared to compile times, network calls, or CI overhead

Benchmark It Yourself

# Run the performance comparison tool
make performance TESTS=100

# Test different scales
make performance TESTS=10    # Small suite
make performance TESTS=1000  # Large suite

# Compare with your actual test suite
time pytest your_tests/ --nyan-only
time pytest your_tests/ -q  # Standard output

Bottom line: Unless you're running thousands of ultra-fast unit tests in tight development loops, nyan cat's constant ~2.3s overhead becomes increasingly negligible as your test suite grows. The joy, motivation, and visual feedback it provides make it a net positive for virtually any development workflow. Adoption is strongly encouraged! ๐ŸŽ‰

๐Ÿ”ง Requirements

  • Python 3.8+
  • pytest 6.0.0+
  • Terminal with ANSI color support (most modern terminals)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run the full test suite: make full-check
  5. Submit a pull request

๐Ÿ“ License

MIT License - see LICENSE file for details.

๐ŸŽ‰ Credits

Inspired by the original Nyan Cat. This one's for the ktties.

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

nyan_pytest-0.1.5.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nyan_pytest-0.1.5-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file nyan_pytest-0.1.5.tar.gz.

File metadata

  • Download URL: nyan_pytest-0.1.5.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for nyan_pytest-0.1.5.tar.gz
Algorithm Hash digest
SHA256 9d50ffc5b6344fdd3f01d8f9471a2aed6c8b4d14a84ae1e09012f39efa11fc79
MD5 46b6d9b6b13b701a2404dc823639a397
BLAKE2b-256 90bcb668e51b99f497bb24da8116aae42a8d97a34fbf2b3240221ffcd789fce5

See more details on using hashes here.

File details

Details for the file nyan_pytest-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: nyan_pytest-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for nyan_pytest-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 726ca398da182483d4cbeb331ca80512808854795c78bca6afd402ae59782c4c
MD5 5b28c82925be8d030c3fd3aa26313550
BLAKE2b-256 5b98a11513d5b8ff80983706b702f7d84edc6c43e5d1dacd82a3ce53b519126c

See more details on using hashes here.

Supported by

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