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!
โจ 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
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run the full test suite:
make full-check - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d50ffc5b6344fdd3f01d8f9471a2aed6c8b4d14a84ae1e09012f39efa11fc79
|
|
| MD5 |
46b6d9b6b13b701a2404dc823639a397
|
|
| BLAKE2b-256 |
90bcb668e51b99f497bb24da8116aae42a8d97a34fbf2b3240221ffcd789fce5
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
726ca398da182483d4cbeb331ca80512808854795c78bca6afd402ae59782c4c
|
|
| MD5 |
5b28c82925be8d030c3fd3aa26313550
|
|
| BLAKE2b-256 |
5b98a11513d5b8ff80983706b702f7d84edc6c43e5d1dacd82a3ce53b519126c
|