File: test_notebooks.py

package info (click to toggle)
python-vector 1.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,984 kB
  • sloc: python: 40,200; makefile: 13
file content (42 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from __future__ import annotations

import sys
from pathlib import Path

import papermill as pm
import pytest


@pytest.fixture
def common_kwargs(tmpdir):
    outputnb = tmpdir.join("output.ipynb")
    return {
        "output_path": str(outputnb),
        "kernel_name": f"python{sys.version_info.major}",
        "progress_bar": False,
    }


def test_object(common_kwargs):
    execution_dir = Path.cwd() / "docs" / "src"
    pm.execute_notebook(execution_dir / "object.ipynb", **common_kwargs)


def test_numpy(common_kwargs):
    execution_dir = Path.cwd() / "docs" / "src"
    pm.execute_notebook(execution_dir / "numpy.ipynb", **common_kwargs)


def test_awkward(common_kwargs):
    execution_dir = Path.cwd() / "docs" / "src"
    pm.execute_notebook(execution_dir / "awkward.ipynb", **common_kwargs)


def test_numba(common_kwargs):
    execution_dir = Path.cwd() / "docs" / "src"
    pm.execute_notebook(execution_dir / "numba.ipynb", **common_kwargs)


def test_sympy(common_kwargs):
    execution_dir = Path.cwd() / "docs" / "src"
    pm.execute_notebook(execution_dir / "sympy.ipynb", **common_kwargs)