|
8 | 8 | @pytest.mark.sphinx_params("basic_run.ipynb", conf={"nb_execution_mode": "off"})
|
9 | 9 | def test_basic_run(sphinx_run, file_regression):
|
10 | 10 | sphinx_run.build()
|
11 |
| - # print(sphinx_run.status()) |
12 | 11 | assert sphinx_run.warnings() == ""
|
13 | 12 | assert set(sphinx_run.env.metadata["basic_run"].keys()) == {
|
14 | 13 | "test_name",
|
@@ -36,6 +35,38 @@ def test_basic_run(sphinx_run, file_regression):
|
36 | 35 | assert filenames == {"basic_run.ipynb"}
|
37 | 36 |
|
38 | 37 |
|
| 38 | +@pytest.mark.sphinx_params( |
| 39 | + "basic_run_intl.ipynb", conf={"language": "es", "locale_dirs": ["locale"]} |
| 40 | +) |
| 41 | +def test_basic_run_intl(sphinx_run, file_regression): |
| 42 | + sphinx_run.build() |
| 43 | + assert sphinx_run.warnings() == "" |
| 44 | + assert set(sphinx_run.env.metadata["basic_run_intl"].keys()) == { |
| 45 | + "test_name", |
| 46 | + "wordcount", |
| 47 | + "kernelspec", |
| 48 | + "language_info", |
| 49 | + } |
| 50 | + assert set(sphinx_run.env.nb_metadata["basic_run_intl"].keys()) == set() |
| 51 | + assert sphinx_run.env.metadata["basic_run_intl"]["test_name"] == "notebook1" |
| 52 | + assert sphinx_run.env.metadata["basic_run_intl"]["kernelspec"] == { |
| 53 | + "display_name": "Python 3", |
| 54 | + "language": "python", |
| 55 | + "name": "python3", |
| 56 | + } |
| 57 | + file_regression.check( |
| 58 | + sphinx_run.get_doctree().pformat(), extension=".xml", encoding="utf-8" |
| 59 | + ) |
| 60 | + |
| 61 | + filenames = { |
| 62 | + p.name |
| 63 | + for p in Path( |
| 64 | + os.fspath(sphinx_run.app.srcdir / "_build" / "jupyter_execute") |
| 65 | + ).iterdir() |
| 66 | + } |
| 67 | + assert filenames == {"basic_run_intl.ipynb"} |
| 68 | + |
| 69 | + |
39 | 70 | @pytest.mark.sphinx_params("complex_outputs.ipynb", conf={"nb_execution_mode": "off"})
|
40 | 71 | def test_complex_outputs(sphinx_run, file_regression):
|
41 | 72 | sphinx_run.build()
|
|
0 commit comments