šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

nyan-pytest

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nyan-pytest

A nyan-cat inspired test reporter for pytest

0.1.4
PyPI
Maintainers
1

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

OptionDescription
--nyanEnable nyan cat reporter alongside default pytest output
--nyan-onlyUse only nyan cat reporter (no standard pytest output)
--nyan-sim NSimulate N tests to demo the animation
--nyan-speed NAnimation speed (1=fastest, 6=default, 100=slowest)

šŸŽ›ļø Speed Guide

Speed RangeBest ForDescription
1-3Fast unit testsQuick visual feedback, minimal distraction
4-8Regular developmentGood balance of visibility and speed (default: 6)
10-25Watching tests runComfortable viewing during test execution
30-60Relaxed developmentSlow, enjoyable animation for longer test suites
70-100Demos & presentationsVery 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

CommandDescription
make setupInstall dev dependencies
make test-nyanRun tests with nyan output
make demoDemo with 20 simulated tests
make performanceRun performance benchmarks
make lintCheck code quality
make formatFormat code
make buildBuild package
make cleanClean 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 CountStandardNyan CatOverhead% Slower
10 tests0.18s2.41s+2.23s+1225%
100 tests1.26s3.52s+2.27s+181%
1000 tests11.97s14.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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts