diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 4a1012b7..483402e4 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -389,14 +389,14 @@ RUN pip install bleach && \ pip install ipywidgets && \ pip install isoweek && \ pip install jedi && \ - pip install Jinja2 && \ pip install jsonschema && \ pip install jupyter-client && \ pip install jupyter-console && \ pip install jupyter-core && \ pip install MarkupSafe && \ pip install mistune && \ - pip install nbconvert && \ + # b/227194111 install latest version of nbconvert until the base image includes nbconvert >= 6.4.5 + pip install --upgrade nbconvert Jinja2 && \ pip install nbformat && \ pip install notebook && \ pip install papermill && \ diff --git a/tests/test_jupyter_nbconvert.py b/tests/test_jupyter_nbconvert.py index b3925993..f2549a50 100644 --- a/tests/test_jupyter_nbconvert.py +++ b/tests/test_jupyter_nbconvert.py @@ -3,7 +3,7 @@ import subprocess class TestJupyterNbconvert(unittest.TestCase): - def test_nbconvert(self): + def test_nbconvert_to_notebook(self): result = subprocess.run([ 'jupyter', 'nbconvert', @@ -17,4 +17,20 @@ def test_nbconvert(self): ], stdout=subprocess.PIPE) self.assertEqual(0, result.returncode) - self.assertTrue(b'999' in result.stdout) \ No newline at end of file + self.assertTrue(b'999' in result.stdout) + + def test_nbconvert_to_html(self): + result = subprocess.run([ + 'jupyter', + 'nbconvert', + '--to', + 'html', + '--template', + '/opt/kaggle/nbconvert-extensions.tpl', + '--execute', + '--stdout', + '/input/tests/data/notebook.ipynb', + ], stdout=subprocess.PIPE) + + self.assertEqual(0, result.returncode) + self.assertTrue(b'999' in result.stdout)