Add a way to easily test units

This commit is contained in:
Ayaz Salikhov
2021-06-26 14:40:45 +03:00
parent 5211732116
commit 30a1d17085
16 changed files with 93 additions and 98 deletions

View File

@@ -7,15 +7,21 @@ import pytest
import os
LOGGER = logging.getLogger(__name__)
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
@pytest.mark.parametrize("test_file, output_format,", [
("notebook_math", "pdf"), ("notebook_math", "html"),
("notebook_svg", "pdf"), ("notebook_svg", "html"),
])
@pytest.mark.parametrize(
"test_file, output_format",
[
("notebook_math", "pdf"),
("notebook_math", "html"),
("notebook_svg", "pdf"),
("notebook_svg", "html")
]
)
def test_nbconvert(container, test_file, output_format):
"""Check if nbconvert is able to convert a notebook file"""
host_data_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
host_data_dir = os.path.join(THIS_DIR, "data")
cont_data_dir = "/home/jovyan/data"
output_dir = "/tmp"
LOGGER.info(f"Test that the example notebook {test_file} can be converted to {output_format.upper()} ...")