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.3.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.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: notebooktester-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ec2ed136e77ebf335f0f24f4b461acda42b12a20db43054338dcbcc4085eb66e
MD5 017c9d57a02ba154e3a48912d43ac38c
BLAKE2b-256 3d385e2924959a0c54732f30374a16128a7434ed0cd6a07b8789d81dd8a6baf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for notebooktester-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ce44c4433f950f92c6914501e1ac9678717c5577cc5ee0eb0e66335ef6673fb
MD5 70ec6368cd8e60a7dce0bb48c58773ff
BLAKE2b-256 e421c724269e59876c6fe40eec944205e81f6fc34d8d84169a46c1ac29bc4fdf

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