Files
docker-stacks/tests/scipy-notebook/test_cython.py
2022-04-01 01:26:37 +01:00

28 lines
840 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from pathlib import Path
from tests.conftest import TrackedContainer
THIS_DIR = Path(__file__).parent.resolve()
def test_cython(container: TrackedContainer) -> None:
host_data_dir = THIS_DIR / "data/cython"
cont_data_dir = "/home/jovyan/data"
logs = container.run_and_wait(
timeout=10,
volumes={str(host_data_dir): {"bind": cont_data_dir, "mode": "ro"}},
tty=True,
command=[
"start.sh",
"bash",
"-c",
# We copy our data to temporary folder to be able to modify the directory
f"cp -r {cont_data_dir}/ /tmp/test/ && cd /tmp/test && python3 setup.py build_ext",
],
)
assert "building 'helloworld' extension" in logs