Skip to main content

Add your description here

Project description

📓 NotebookTester

uv image

A fast, reliable, and parallel Jupyter notebook testing tool with caching support! Test your notebooks with confidence.

🌟 Features

  • 🚀 Parallel Execution: Test multiple notebooks simultaneously
  • ⏱️ Configurable Timeouts: Set custom timeouts for notebook execution
  • 💾 Smart Caching: Cache test results to avoid unnecessary re-runs
  • 🎯 Selective Testing: Only test modified notebooks
  • 📊 Detailed Logging: Comprehensive logs with test results and errors
  • 🛠️ CLI Support: Easy to use command-line interface

🔧 Installation

Choose your preferred package manager:

Using pip (slow legacy)

pip install notebooktester

Using uv (10-100x faster)

see uv docs for more info.

uv add notebooktester

🚀 Quick Start

Test a single notebook:

notebooktester path/to/your/notebook.ipynb

Test all notebooks in a directory:

notebooktester path/to/notebooks/directory

🎮 Command Line Options

notebooktester [OPTIONS] PATH

Options:

  • -t, --timeout SECONDS: Timeout in seconds for each notebook (default: 60)
  • -w, --workers NUMBER: Number of parallel workers (default: CPU count)
  • -c, --cache-dir PATH: Cache directory for test results (default: .notebookcache)
  • -v, --verbose: Enable verbose output
  • -f, --force: Ignore cache and force test execution

📋 Example Usage

Basic usage:

notebooktester notebooks/

With custom timeout and workers:

notebooktester notebooks/ -t 120 -w 4

Force re-run all tests:

notebooktester notebooks/ --force

🔍 Cache Behavior

NotebookTester maintains a cache of test results to optimize performance:

  • Only notebooks modified since their last test run are re-tested
  • If the notebook timed out, and the current timeout has not been increased, notebook is skipped
  • Cached results include success/failure status and error messages
  • Force flag (-f) bypasses the cache

📊 Output

The tool provides:

  • Progress bar for test execution
  • Colored console output for test results
  • Detailed logs in the logs/ directory
  • Summary of passed and failed tests

Example output:

>>notebooktester notebooks/ -t 120 -w 4
Running tests with 4 workers
Starting notebook tests - found 10 notebooks
✅ PASSED - notebook1.ipynb: Success
❌ FAILED - notebook2.ipynb: Cell execution error
⏰ TIMEOUT - notebook3.ipynb: A cell timed out

Test Summary: 8 passed, 2 failed

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

👤 Author

Raoul Grouls (Raoul.Grouls@han.nl)

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

notebooktester-0.1.2.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

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

notebooktester-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file notebooktester-0.1.2.tar.gz.

File metadata

  • Download URL: notebooktester-0.1.2.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for notebooktester-0.1.2.tar.gz
Algorithm Hash digest
SHA256 38b7d1ca16184098c353f786ec692b51813489f2368a61aed4ca9a90fa7b6cec
MD5 fb1e1716d3b1777d7e9c439f66462745
BLAKE2b-256 444e0674f443d2b4a73c2729fceb1dab36222fc0093691ba71cad1ed7d4108ca

See more details on using hashes here.

File details

Details for the file notebooktester-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for notebooktester-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 71c043333e3460a173df53bb1400bd5e4ad8ab9fe136abba9ee90b1d40e986e1
MD5 0b39dd76a46a312358f0eb2810ea8680
BLAKE2b-256 2747d5e9b1b43f5cb27753d64d3c5e33bfbc28e8c8468d9881a9c73e29a8ed50

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