jupyter_notebook_test

Rules

jupyter_notebook_test

load("@rules_jupyter//jupyter:jupyter_notebook_test.bzl", "jupyter_notebook_test")

jupyter_notebook_test(name, data, cwd_mode, env, env_inherit, exporter_args, notebook, reports)

A test rule that executes a Jupyter notebook and optionally generates reports. The test fails if any notebook cell raises an error.

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
dataAdditional data files required by the notebook (e.g., input data files, images, configuration files).List of labelsoptional[]
cwd_modeThe working directory mode for notebook execution. If not specified, uses the toolchain's default_cwd.Stringoptional""
envEnvironment variables to set when executing the notebook. Values support location expansion (e.g., $(location :target)).Dictionary: String -> Stringoptional{}
env_inheritSpecifies additional environment variables to inherit from the external environment when the test is executed by bazel test.List of stringsoptional[]
exporter_argsTraitlets-style flags forwarded to nbconvert exporters (e.g. --WebPDFExporter.exclude_input=true).List of stringsoptional[]
notebookThe notebook to execute and test. Must be a jupyter_notebook target.Labelrequired
reportsList of report types to generate after successful notebook execution. Valid values: 'html', 'markdown', 'latex'.List of stringsoptional["webpdf"]