pytest-nbgrader

Versions

PyPI

Documentation and Support

Documentation Status Supported Python Versions

Open Source

License OpenSSF Scorecard

Coding Standards

Ruff pre-commit.ci status

Development Status

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status Coveralls

Pytest plugin for using with nbgrader and generating test cases.

Features

  • Load student submissions from Jupyter notebooks via Submission class

  • Define test cases with expected inputs/outputs using TestCase and TestSubtask dataclasses

  • Execute student code against test cases with automatic result comparison

  • Serialize and deserialize test cases via YAML

  • Prerequisite checks: function signature validation, write-access verification

  • Assertion helpers for numeric comparisons (numpy-based tolerances)

  • Automatic pytest test class generation via TestClass harness

  • Run pytest from within notebooks using the runner module

  • Plugs into pytest as a standard plugin — no configuration needed beyond install

Credits

This package was created with Cookiecutter and the Ouranosinc/cookiecutter-pypackage project template.