diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 59460527..2cce08a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,16 +39,24 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[testing] - - name: Test with pytest + - name: Run pytest run: | - pip install pytest - pytest --cov=myst_nb --cov-report= - - name: Upload to coveralls - run: | - pip install coveralls - coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_KEY }} + pytest --durations=10 --cov=myst_nb --cov-report=xml --cov-report=term-missing + coverage xml + # - name: Upload to coveralls + # run: | + # pip install coveralls + # coveralls + # env: + # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_KEY }} + - name: Upload to Codecov + if: matrix.python-version == 3.7 && github.repository == 'ExecutableBookProject/MyST-NB' + uses: codecov/codecov-action@v1 + with: + name: myst-nb-pytests-py3.7 + flags: pytests + file: ./coverage.xml + fail_ci_if_error: true publish: diff --git a/setup.py b/setup.py index 87143f3a..cc92d4ac 100644 --- a/setup.py +++ b/setup.py @@ -56,16 +56,14 @@ extras_require={ "code_style": ["flake8<3.8.0,>=3.7.0", "black", "pre-commit==1.17.0"], "testing": [ - "coverage", - "pytest>=3.6,<4", - "pytest-cov", + "pytest~=5.4", + "pytest-cov~=2.8", + "coverage<5.0", "pytest-regressions", - "beautifulsoup4", "matplotlib", "numpy", "sympy", "pandas", - "ipypublish", ], "rtd": [ "sphinxcontrib-bibtex", diff --git a/tests/notebooks/complex_outputs.ipynb b/tests/notebooks/complex_outputs.ipynb index e4677829..b557d0b4 100644 --- a/tests/notebooks/complex_outputs.ipynb +++ b/tests/notebooks/complex_outputs.ipynb @@ -12,7 +12,13 @@ }, "outputs": [], "source": [ - "from ipypublish.scripts.ipynb_latex_setup import *" + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "pd.set_option('display.latex.repr', True)\n", + "import sympy as sym\n", + "sym.init_printing(use_latex=True)\n", + "import numpy as np\n", + "from IPython.display import Image, Latex" ] }, { diff --git a/tests/notebooks/complex_outputs_unrun.ipynb b/tests/notebooks/complex_outputs_unrun.ipynb index b08f5c03..4860968e 100644 --- a/tests/notebooks/complex_outputs_unrun.ipynb +++ b/tests/notebooks/complex_outputs_unrun.ipynb @@ -11,10 +11,11 @@ }, "outputs": [], "source": [ - "from ipypublish import nb_setup\n", - "plt = nb_setup.setup_matplotlib(print_errors=True, output=('svg',))\n", - "pd = nb_setup.setup_pandas(escape_latex=True)\n", - "sym = nb_setup.setup_sympy()\n", + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "pd.set_option('display.latex.repr', True)\n", + "import sympy as sym\n", + "sym.init_printing(use_latex=True)\n", "import numpy as np\n", "from IPython.display import Image, Latex" ] diff --git a/tests/test_execute/test_complex_outputs_unrun.ipynb b/tests/test_execute/test_complex_outputs_unrun.ipynb index 3018eac9..5a8faaf0 100644 --- a/tests/test_execute/test_complex_outputs_unrun.ipynb +++ b/tests/test_execute/test_complex_outputs_unrun.ipynb @@ -11,10 +11,11 @@ }, "outputs": [], "source": [ - "from ipypublish import nb_setup\n", - "plt = nb_setup.setup_matplotlib(print_errors=True, output=('svg',))\n", - "pd = nb_setup.setup_pandas(escape_latex=True)\n", - "sym = nb_setup.setup_sympy()\n", + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "pd.set_option('display.latex.repr', True)\n", + "import sympy as sym\n", + "sym.init_printing(use_latex=True)\n", "import numpy as np\n", "from IPython.display import Image, Latex" ] @@ -429,7 +430,7 @@ "execution_count": 5, "metadata": { "filenames": { - "image/png": "/private/var/folders/dm/b2qnkb_n3r72slmpxlfmcjvm00lbnd/T/pytest-of-cjs14/pytest-846/test_complex_outputs_unrun0/source/_build/jupyter_execute/complex_outputs_unrun_22_0.png" + "image/png": "/private/var/folders/dm/b2qnkb_n3r72slmpxlfmcjvm00lbnd/T/pytest-of-cjs14/pytest-27/test_complex_outputs_unrun0/source/_build/jupyter_execute/complex_outputs_unrun_22_0.png" } }, "output_type": "execute_result" @@ -502,7 +503,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.10" + "version": "3.7.6" }, "latex_envs": { "LaTeX_envs_menu_present": true, diff --git a/tests/test_execute/test_complex_outputs_unrun.xml b/tests/test_execute/test_complex_outputs_unrun.xml index baa6920d..1234a8f0 100644 --- a/tests/test_execute/test_complex_outputs_unrun.xml +++ b/tests/test_execute/test_complex_outputs_unrun.xml @@ -2,10 +2,11 @@ - from ipypublish import nb_setup - plt = nb_setup.setup_matplotlib(print_errors=True, output=('svg',)) - pd = nb_setup.setup_pandas(escape_latex=True) - sym = nb_setup.setup_sympy() + import matplotlib.pyplot as plt + import pandas as pd + pd.set_option('display.latex.repr', True) + import sympy as sym + sym.init_printing(use_latex=True) import numpy as np from IPython.display import Image, Latex diff --git a/tests/test_execute/test_complex_outputs_unrun_nbclient.ipynb b/tests/test_execute/test_complex_outputs_unrun_nbclient.ipynb index 230267a6..7e0285be 100644 --- a/tests/test_execute/test_complex_outputs_unrun_nbclient.ipynb +++ b/tests/test_execute/test_complex_outputs_unrun_nbclient.ipynb @@ -11,10 +11,11 @@ }, "outputs": [], "source": [ - "from ipypublish import nb_setup\n", - "plt = nb_setup.setup_matplotlib(print_errors=True, output=('svg',))\n", - "pd = nb_setup.setup_pandas(escape_latex=True)\n", - "sym = nb_setup.setup_sympy()\n", + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "pd.set_option('display.latex.repr', True)\n", + "import sympy as sym\n", + "sym.init_printing(use_latex=True)\n", "import numpy as np\n", "from IPython.display import Image, Latex" ] diff --git a/tests/test_execute/test_complex_outputs_unrun_nbclient.xml b/tests/test_execute/test_complex_outputs_unrun_nbclient.xml index baa6920d..1234a8f0 100644 --- a/tests/test_execute/test_complex_outputs_unrun_nbclient.xml +++ b/tests/test_execute/test_complex_outputs_unrun_nbclient.xml @@ -2,10 +2,11 @@ - from ipypublish import nb_setup - plt = nb_setup.setup_matplotlib(print_errors=True, output=('svg',)) - pd = nb_setup.setup_pandas(escape_latex=True) - sym = nb_setup.setup_sympy() + import matplotlib.pyplot as plt + import pandas as pd + pd.set_option('display.latex.repr', True) + import sympy as sym + sym.init_printing(use_latex=True) import numpy as np from IPython.display import Image, Latex diff --git a/tests/test_parser/test_complex_outputs.xml b/tests/test_parser/test_complex_outputs.xml index 7fca9ac1..e4a4fc58 100644 --- a/tests/test_parser/test_complex_outputs.xml +++ b/tests/test_parser/test_complex_outputs.xml @@ -2,7 +2,13 @@ - from ipypublish.scripts.ipynb_latex_setup import * + import matplotlib.pyplot as plt + import pandas as pd + pd.set_option('display.latex.repr', True) + import sympy as sym + sym.init_printing(use_latex=True) + import numpy as np + from IPython.display import Image, Latex
diff --git a/tests/test_transform/test_complex_outputs.xml b/tests/test_transform/test_complex_outputs.xml index ede76ecc..451321de 100644 --- a/tests/test_transform/test_complex_outputs.xml +++ b/tests/test_transform/test_complex_outputs.xml @@ -2,7 +2,13 @@ - from ipypublish.scripts.ipynb_latex_setup import * + import matplotlib.pyplot as plt + import pandas as pd + pd.set_option('display.latex.repr', True) + import sympy as sym + sym.init_printing(use_latex=True) + import numpy as np + from IPython.display import Image, Latex