|
7 | 7 | import os |
8 | 8 |
|
9 | 9 | LOGGER = logging.getLogger(__name__) |
| 10 | +THIS_DIR = os.path.dirname(os.path.realpath(__file__)) |
10 | 11 |
|
11 | 12 |
|
12 | | -@pytest.mark.parametrize("test_file, output_format,", [ |
13 | | - ("notebook_math", "pdf"), ("notebook_math", "html"), |
14 | | - ("notebook_svg", "pdf"), ("notebook_svg", "html"), |
15 | | -]) |
| 13 | +@pytest.mark.parametrize( |
| 14 | + "test_file, output_format", |
| 15 | + [ |
| 16 | + ("notebook_math", "pdf"), |
| 17 | + ("notebook_math", "html"), |
| 18 | + ("notebook_svg", "pdf"), |
| 19 | + ("notebook_svg", "html"), |
| 20 | + ], |
| 21 | +) |
16 | 22 | def test_nbconvert(container, test_file, output_format): |
17 | 23 | """Check if nbconvert is able to convert a notebook file""" |
18 | | - host_data_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data") |
| 24 | + host_data_dir = os.path.join(THIS_DIR, "data") |
19 | 25 | cont_data_dir = "/home/jovyan/data" |
20 | 26 | output_dir = "/tmp" |
21 | | - LOGGER.info(f"Test that the example notebook {test_file} can be converted to {output_format.upper()} ...") |
| 27 | + LOGGER.info(f"Test that the example notebook {test_file} can be converted to {output_format} ...") |
22 | 28 | command = f"jupyter nbconvert {cont_data_dir}/{test_file}.ipynb --output-dir {output_dir} --to {output_format}" |
23 | 29 | c = container.run( |
24 | 30 | volumes={host_data_dir: {"bind": cont_data_dir, "mode": "ro"}}, |
|
0 commit comments