Skip to content

Instantly share code, notes, and snippets.

@Ken-B
Created February 28, 2017 09:05
Show Gist options
  • Save Ken-B/c0583abdd049839ee26705b6b1ecd677 to your computer and use it in GitHub Desktop.
Save Ken-B/c0583abdd049839ee26705b6b1ecd677 to your computer and use it in GitHub Desktop.
nbconvert test a177dd3
nbconvert git:(font_issues) py.test --pyargs nbconvert
============================= test session starts ==============================
platform darwin -- Python 3.6.0, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /Users/ken/Coding/nbconvert, inifile:
collected 222 items
nbconvert/exporters/tests/test_asciidoc.py ....
nbconvert/exporters/tests/test_export.py ...........
nbconvert/exporters/tests/test_exporter.py .....
nbconvert/exporters/tests/test_html.py .........
nbconvert/exporters/tests/test_latex.py ..FFF.....
nbconvert/exporters/tests/test_markdown.py ....
nbconvert/exporters/tests/test_notebook.py .....
nbconvert/exporters/tests/test_pdf.py ..F.
nbconvert/exporters/tests/test_python.py ....
nbconvert/exporters/tests/test_rst.py .....
nbconvert/exporters/tests/test_script.py ......
nbconvert/exporters/tests/test_slides.py ......
nbconvert/exporters/tests/test_templateexporter.py .............
nbconvert/filters/tests/test_ansi.py ...
nbconvert/filters/tests/test_citation.py ...................
nbconvert/filters/tests/test_datatypefilter.py ...
nbconvert/filters/tests/test_highlight.py ...
nbconvert/filters/tests/test_latex.py .
nbconvert/filters/tests/test_markdown.py .........
nbconvert/filters/tests/test_metadata.py .
nbconvert/filters/tests/test_strings.py ............
nbconvert/postprocessors/tests/test_serve.py .
nbconvert/preprocessors/tests/test_clearoutput.py ..
nbconvert/preprocessors/tests/test_coalescestreams.py ...
nbconvert/preprocessors/tests/test_csshtmlheader.py ..
nbconvert/preprocessors/tests/test_execute.py ........
nbconvert/preprocessors/tests/test_extractoutput.py ..
nbconvert/preprocessors/tests/test_highlightmagics.py ...
nbconvert/preprocessors/tests/test_latex.py ..
nbconvert/preprocessors/tests/test_sanitize.py .........
nbconvert/preprocessors/tests/test_svg2pdf.py .s
nbconvert/tests/test_nbconvertapp.py ...................................
nbconvert/utils/tests/test_io.py ..
nbconvert/utils/tests/test_pandoc.py ..
nbconvert/writers/tests/test_debug.py .
nbconvert/writers/tests/test_files.py ..........
nbconvert/writers/tests/test_stdout.py .
=================================== FAILURES ===================================
________________________ TestLatexExporter.test_export _________________________
self = <nbconvert.exporters.tests.test_latex.TestLatexExporter testMethod=test_export>
@onlyif_cmds_exist('pandoc')
def test_export(self):
"""
Can a LatexExporter export something?
"""
> (output, resources) = LatexExporter().from_filename(self._get_notebook())
nbconvert/exporters/tests/test_latex.py:37:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
nbconvert/exporters/exporter.py:171: in from_filename
return self.from_file(f, resources=resources, **kw)
nbconvert/exporters/exporter.py:189: in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
nbconvert/exporters/latex.py:82: in from_notebook_node
return super(LatexExporter, self).from_notebook_node(nb, resources, **kw)
nbconvert/exporters/templateexporter.py:239: in from_notebook_node
output = self.template.render(nb=nb_copy, resources=resources)
../../anaconda3/lib/python3.6/site-packages/jinja2/asyncsupport.py:76: in render
return original_render(self, *args, **kwargs)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:1008: in render
return self.environment.handle_exception(exc_info, True)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:780: in handle_exception
reraise(exc_type, exc_value, tb)
../../anaconda3/lib/python3.6/site-packages/jinja2/_compat.py:37: in reraise
raise value.with_traceback(tb)
nbconvert/templates/latex/article.tplx:8: in top-level template code
((* extends cell_style *))
nbconvert/templates/latex/style_ipython.tplx:56: in top-level template code
((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
nbconvert/templates/latex/base.tplx:6: in top-level template code
((*- extends 'document_contents.tplx' -*))
nbconvert/templates/latex/document_contents.tplx:50: in top-level template code
((*- block figure scoped -*))
nbconvert/templates/latex/skeleton/display_priority.tplx:5: in top-level template code
((*- extends 'null.tplx' -*))
nbconvert/templates/latex/skeleton/null.tplx:30: in top-level template code
((*- block body -*))
nbconvert/templates/latex/base.tplx:183: in block "body"
((( super() )))
nbconvert/templates/latex/skeleton/null.tplx:32: in block "body"
((*- block any_cell scoped -*))
nbconvert/templates/latex/skeleton/null.tplx:76: in block "any_cell"
((*- block markdowncell scoped-*))
nbconvert/templates/latex/document_contents.tplx:67: in block "markdowncell"
((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'json',extra_args=[]) | resolve_references | convert_pandoc('json','latex'))))
nbconvert/filters/filter_links.py:16: in resolve_references
return applyJSONFilters([resolve_one_reference], source)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:197: in applyJSONFilters
altered = walk(altered, action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:120: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:113: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:124: in walk
x[k] = walk(x[k], action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:111: in walk
item['c'] if 'c' in item else None, format, meta)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
key = 'Link'
val = [[{'c': 'header', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'links', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'are', 't': 'Str'}, {'c': [], 't': 'Space'}, ...], ['#numpy-and-matplotlib-examples', '']]
fmt = '', meta = {}
def resolve_one_reference(key, val, fmt, meta):
"""
This takes a tuple of arguments that are compatible with ``pandocfilters.walk()`` that
allows identifying hyperlinks in the document and transforms them into valid LaTeX
\\ref{} calls so that linking to headers between cells is possible.
See the documentation in ``pandocfilters.walk()`` for further information on the meaning
and specification of ``key``, ``val``, ``fmt``, and ``meta``.
"""
if key == 'Link':
> target = val[2][0]
E IndexError: list index out of range
nbconvert/filters/filter_links.py:29: IndexError
____________________ TestLatexExporter.test_export_article _____________________
self = <nbconvert.exporters.tests.test_latex.TestLatexExporter testMethod=test_export_article>
@onlyif_cmds_exist('pandoc')
def test_export_article(self):
"""
Can a LatexExporter export using 'article' template?
"""
> (output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
nbconvert/exporters/tests/test_latex.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
nbconvert/exporters/exporter.py:171: in from_filename
return self.from_file(f, resources=resources, **kw)
nbconvert/exporters/exporter.py:189: in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
nbconvert/exporters/latex.py:82: in from_notebook_node
return super(LatexExporter, self).from_notebook_node(nb, resources, **kw)
nbconvert/exporters/templateexporter.py:239: in from_notebook_node
output = self.template.render(nb=nb_copy, resources=resources)
../../anaconda3/lib/python3.6/site-packages/jinja2/asyncsupport.py:76: in render
return original_render(self, *args, **kwargs)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:1008: in render
return self.environment.handle_exception(exc_info, True)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:780: in handle_exception
reraise(exc_type, exc_value, tb)
../../anaconda3/lib/python3.6/site-packages/jinja2/_compat.py:37: in reraise
raise value.with_traceback(tb)
nbconvert/templates/latex/article.tplx:8: in top-level template code
((* extends cell_style *))
nbconvert/templates/latex/style_ipython.tplx:56: in top-level template code
((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
nbconvert/templates/latex/base.tplx:6: in top-level template code
((*- extends 'document_contents.tplx' -*))
nbconvert/templates/latex/document_contents.tplx:50: in top-level template code
((*- block figure scoped -*))
nbconvert/templates/latex/skeleton/display_priority.tplx:5: in top-level template code
((*- extends 'null.tplx' -*))
nbconvert/templates/latex/skeleton/null.tplx:30: in top-level template code
((*- block body -*))
nbconvert/templates/latex/base.tplx:183: in block "body"
((( super() )))
nbconvert/templates/latex/skeleton/null.tplx:32: in block "body"
((*- block any_cell scoped -*))
nbconvert/templates/latex/skeleton/null.tplx:76: in block "any_cell"
((*- block markdowncell scoped-*))
nbconvert/templates/latex/document_contents.tplx:67: in block "markdowncell"
((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'json',extra_args=[]) | resolve_references | convert_pandoc('json','latex'))))
nbconvert/filters/filter_links.py:16: in resolve_references
return applyJSONFilters([resolve_one_reference], source)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:197: in applyJSONFilters
altered = walk(altered, action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:120: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:113: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:124: in walk
x[k] = walk(x[k], action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:111: in walk
item['c'] if 'c' in item else None, format, meta)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
key = 'Link'
val = [[{'c': 'header', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'links', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'are', 't': 'Str'}, {'c': [], 't': 'Space'}, ...], ['#numpy-and-matplotlib-examples', '']]
fmt = '', meta = {}
def resolve_one_reference(key, val, fmt, meta):
"""
This takes a tuple of arguments that are compatible with ``pandocfilters.walk()`` that
allows identifying hyperlinks in the document and transforms them into valid LaTeX
\\ref{} calls so that linking to headers between cells is possible.
See the documentation in ``pandocfilters.walk()`` for further information on the meaning
and specification of ``key``, ``val``, ``fmt``, and ``meta``.
"""
if key == 'Link':
> target = val[2][0]
E IndexError: list index out of range
nbconvert/filters/filter_links.py:29: IndexError
_____________________ TestLatexExporter.test_export_basic ______________________
self = <nbconvert.exporters.tests.test_latex.TestLatexExporter testMethod=test_export_basic>
@onlyif_cmds_exist('pandoc')
def test_export_basic(self):
"""
Can a LatexExporter export using 'article' template?
"""
> (output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
nbconvert/exporters/tests/test_latex.py:55:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
nbconvert/exporters/exporter.py:171: in from_filename
return self.from_file(f, resources=resources, **kw)
nbconvert/exporters/exporter.py:189: in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
nbconvert/exporters/latex.py:82: in from_notebook_node
return super(LatexExporter, self).from_notebook_node(nb, resources, **kw)
nbconvert/exporters/templateexporter.py:239: in from_notebook_node
output = self.template.render(nb=nb_copy, resources=resources)
../../anaconda3/lib/python3.6/site-packages/jinja2/asyncsupport.py:76: in render
return original_render(self, *args, **kwargs)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:1008: in render
return self.environment.handle_exception(exc_info, True)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:780: in handle_exception
reraise(exc_type, exc_value, tb)
../../anaconda3/lib/python3.6/site-packages/jinja2/_compat.py:37: in reraise
raise value.with_traceback(tb)
nbconvert/templates/latex/article.tplx:8: in top-level template code
((* extends cell_style *))
nbconvert/templates/latex/style_ipython.tplx:56: in top-level template code
((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
nbconvert/templates/latex/base.tplx:6: in top-level template code
((*- extends 'document_contents.tplx' -*))
nbconvert/templates/latex/document_contents.tplx:50: in top-level template code
((*- block figure scoped -*))
nbconvert/templates/latex/skeleton/display_priority.tplx:5: in top-level template code
((*- extends 'null.tplx' -*))
nbconvert/templates/latex/skeleton/null.tplx:30: in top-level template code
((*- block body -*))
nbconvert/templates/latex/base.tplx:183: in block "body"
((( super() )))
nbconvert/templates/latex/skeleton/null.tplx:32: in block "body"
((*- block any_cell scoped -*))
nbconvert/templates/latex/skeleton/null.tplx:76: in block "any_cell"
((*- block markdowncell scoped-*))
nbconvert/templates/latex/document_contents.tplx:67: in block "markdowncell"
((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'json',extra_args=[]) | resolve_references | convert_pandoc('json','latex'))))
nbconvert/filters/filter_links.py:16: in resolve_references
return applyJSONFilters([resolve_one_reference], source)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:197: in applyJSONFilters
altered = walk(altered, action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:120: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:113: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:124: in walk
x[k] = walk(x[k], action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:111: in walk
item['c'] if 'c' in item else None, format, meta)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
key = 'Link'
val = [[{'c': 'header', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'links', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'are', 't': 'Str'}, {'c': [], 't': 'Space'}, ...], ['#numpy-and-matplotlib-examples', '']]
fmt = '', meta = {}
def resolve_one_reference(key, val, fmt, meta):
"""
This takes a tuple of arguments that are compatible with ``pandocfilters.walk()`` that
allows identifying hyperlinks in the document and transforms them into valid LaTeX
\\ref{} calls so that linking to headers between cells is possible.
See the documentation in ``pandocfilters.walk()`` for further information on the meaning
and specification of ``key``, ``val``, ``fmt``, and ``meta``.
"""
if key == 'Link':
> target = val[2][0]
E IndexError: list index out of range
nbconvert/filters/filter_links.py:29: IndexError
_____________________________ TestPDF.test_export ______________________________
self = <nbconvert.exporters.tests.test_pdf.TestPDF testMethod=test_export>
@dec.onlyif_cmds_exist('xelatex')
@dec.onlyif_cmds_exist('pandoc')
def test_export(self):
"""Smoke test PDFExporter"""
with tempdir.TemporaryDirectory() as td:
newpath = os.path.join(td, os.path.basename(self._get_notebook()))
shutil.copy(self._get_notebook(), newpath)
> (output, resources) = self.exporter_class(latex_count=1).from_filename(newpath)
nbconvert/exporters/tests/test_pdf.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
nbconvert/exporters/exporter.py:171: in from_filename
return self.from_file(f, resources=resources, **kw)
nbconvert/exporters/exporter.py:189: in from_file
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
nbconvert/exporters/pdf.py:162: in from_notebook_node
nb, resources=resources, **kw
nbconvert/exporters/latex.py:82: in from_notebook_node
return super(LatexExporter, self).from_notebook_node(nb, resources, **kw)
nbconvert/exporters/templateexporter.py:239: in from_notebook_node
output = self.template.render(nb=nb_copy, resources=resources)
../../anaconda3/lib/python3.6/site-packages/jinja2/asyncsupport.py:76: in render
return original_render(self, *args, **kwargs)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:1008: in render
return self.environment.handle_exception(exc_info, True)
../../anaconda3/lib/python3.6/site-packages/jinja2/environment.py:780: in handle_exception
reraise(exc_type, exc_value, tb)
../../anaconda3/lib/python3.6/site-packages/jinja2/_compat.py:37: in reraise
raise value.with_traceback(tb)
nbconvert/templates/latex/article.tplx:8: in top-level template code
((* extends cell_style *))
nbconvert/templates/latex/style_ipython.tplx:56: in top-level template code
((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
nbconvert/templates/latex/base.tplx:6: in top-level template code
((*- extends 'document_contents.tplx' -*))
nbconvert/templates/latex/document_contents.tplx:50: in top-level template code
((*- block figure scoped -*))
nbconvert/templates/latex/skeleton/display_priority.tplx:5: in top-level template code
((*- extends 'null.tplx' -*))
nbconvert/templates/latex/skeleton/null.tplx:30: in top-level template code
((*- block body -*))
nbconvert/templates/latex/base.tplx:183: in block "body"
((( super() )))
nbconvert/templates/latex/skeleton/null.tplx:32: in block "body"
((*- block any_cell scoped -*))
nbconvert/templates/latex/skeleton/null.tplx:76: in block "any_cell"
((*- block markdowncell scoped-*))
nbconvert/templates/latex/document_contents.tplx:67: in block "markdowncell"
((( cell.source | citation2latex | strip_files_prefix | convert_pandoc('markdown', 'json',extra_args=[]) | resolve_references | convert_pandoc('json','latex'))))
nbconvert/filters/filter_links.py:16: in resolve_references
return applyJSONFilters([resolve_one_reference], source)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:197: in applyJSONFilters
altered = walk(altered, action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:120: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:113: in walk
array.append(walk(item, action, format, meta))
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:124: in walk
x[k] = walk(x[k], action, format, meta)
../../anaconda3/lib/python3.6/site-packages/pandocfilters.py:111: in walk
item['c'] if 'c' in item else None, format, meta)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
key = 'Link'
val = [[{'c': 'header', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'links', 't': 'Str'}, {'c': [], 't': 'Space'}, {'c': 'are', 't': 'Str'}, {'c': [], 't': 'Space'}, ...], ['#numpy-and-matplotlib-examples', '']]
fmt = '', meta = {}
def resolve_one_reference(key, val, fmt, meta):
"""
This takes a tuple of arguments that are compatible with ``pandocfilters.walk()`` that
allows identifying hyperlinks in the document and transforms them into valid LaTeX
\\ref{} calls so that linking to headers between cells is possible.
See the documentation in ``pandocfilters.walk()`` for further information on the meaning
and specification of ``key``, ``val``, ``fmt``, and ``meta``.
"""
if key == 'Link':
> target = val[2][0]
E IndexError: list index out of range
nbconvert/filters/filter_links.py:29: IndexError
============== 4 failed, 217 passed, 1 skipped in 104.76 seconds ==============
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment