tex2ipy icon indicating copy to clipboard operation
tex2ipy copied to clipboard

Failing tests

Open boileaum opened this issue 3 years ago • 0 comments

With the current environment:

~$ python -V && pip freeze
Python 3.9.1
attrs==20.3.0
iniconfig==1.1.1
ipython-genutils==0.2.0
jsonschema==3.2.0
jupyter-core==4.7.1
nbformat==5.1.3
packaging==20.9
pluggy==0.13.1
py==1.10.0
pyparsing==2.4.7
pyrsistent==0.17.3
pytest==6.2.3
six==1.15.0
-e git+https://github.com/prabhuramachandran/tex2ipy.git@46a1119e71caedf3cb0faece20ec17d3b8d1cc87#egg=tex2ipy
TexSoup==0.3.1
toml==0.10.2
traitlets==5.0.5

The tests fail on my system (MacOS 10.15.7):

~$ pytest
======================================================================================================================== test session starts ========================================================================================================================
platform darwin -- Python 3.9.1, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: /Users/boileau/Documents/Git/Python/tex2ipy
collected 28 items                                                                                                                                                                                                                                                  

tex2ipy/tests/test_tex2cells.py ...FFF..F......FFF...FF                                                                                                                                                                                                       [ 82%]
tex2ipy/tests/test_tex2ipy.py .....                                      
[...]
====================================================================================================================== short test summary info ======================================================================================================================
FAILED tex2ipy/tests/test_tex2cells.py::test_lstlisting_with_output_should_make_multiple_cells - AssertionError: assert 2 == 3
FAILED tex2ipy/tests/test_tex2cells.py::test_multiple_lstlistings - AssertionError: assert ['*  blah\n'] == ['* blah\n']
FAILED tex2ipy/tests/test_tex2cells.py::test_lstlistings_inside_itemize - AssertionError: assert 3 == 4
FAILED tex2ipy/tests/test_tex2cells.py::test_itemize_enumerate_works - AssertionError: assert '*  item 1\n    \n' == '* item 1\n'
FAILED tex2ipy/tests/test_tex2cells.py::test_inline_equations - AssertionError: assert ['\\$ \\int  ...mma  world\n'] == ['$\\int f(x)...ma}$ world\n']
FAILED tex2ipy/tests/test_tex2cells.py::test_equations - AssertionError: assert '\\alpha + \\...{2}\\beta_1\n' == '\\alpha + \\...2} \\beta_1\n'
FAILED tex2ipy/tests/test_tex2cells.py::test_pause_should_add_new_fragment - AssertionError: assert '*  item 1\n' == '* item 1'
FAILED tex2ipy/tests/test_tex2cells.py::test_block_is_handled - AssertionError: assert '### {Test block}\n' == '### Test block\n'
FAILED tex2ipy/tests/test_tex2cells.py::test_title_can_have_text_embellishments - AssertionError: assert '## *emph* **...ha `print` \n' == '## *emph*  *...$  `print` \n'
=================================================================================================================== 9 failed, 19 passed in 0.95s ====================================================================================================================

For example, inline latex equations are not properly converted:

~$ cat test_tex2ipy.tex 
\begin{document}
\begin{frame}
$\int f(x) dx$
\begin{itemize}
\item hello $\alpha + \frac{1}{2} \beta_{\gamma}$ world
\end{itemize}
\end{frame}
\end{document}
~$ tex2ipy test_tex2ipy.tex test_tex2ipy.ipynb
No handler for  $
No handler for  int
No handler for  $
No handler for  alpha
No handler for  frac
No handler for  beta
No handler for  BraceGroup
No handler for  gamma
~$ cat test_tex2ipy.ipynb 
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b74f568f",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "\\$ \\int  f(x) dx\n",
    "*  hello \\$ \\alpha  + \\frac 12\\beta _\\BraceGroup \\gamma  world\n"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "language": "python",
  "livereveal": {
   "controls": true,
   "help": true,
   "scroll": true,
   "slideNumber": true,
   "transition": "none"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}

boileaum avatar Apr 17 '21 08:04 boileaum