MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Unit test failures on Python 3.11

Open amolenaar opened this issue 3 years ago • 1 comments

Describe the bug

context

When I run the unit tests on my Linux machine (Fedora 37), 5 tests fail.

expectation I expected all tests to pass.

bug

Instead 5 tests fail.

$ pip install -e '.[testing]'
...
$ pytest
...
FAILED tests/test_execute.py::test_basic_failing_cache - AssertionError: FILES DIFFER:
FAILED tests/test_execute.py::test_basic_failing_auto - AssertionError: FILES DIFFER:
FAILED tests/test_execute.py::test_basic_failing_inline - AssertionError: FILES DIFFER:
FAILED tests/test_execute.py::test_allow_errors_cache - AssertionError: FILES DIFFER:
FAILED tests/test_execute.py::test_allow_errors_auto - AssertionError: FILES DIFFER:

$ pytest tests/test_execute.py::test_basic_failing_inline
...
## inserted before test_basic_failing_inline.ipynb/cells/1/outputs/0/traceback/2:
+  item[0]:
+    Input In [1], in <cell line: 1>()
+    ----> 1 raise Exception('oopsie!')

## deleted test_basic_failing_inline.ipynb/cells/1/outputs/0/traceback/2:
-  item[0]:
-    Input In [1], in <cell line: 0>()
-    ----> 1 raise Exception('oopsie!')

problem It looks like the first line in the cell is referred to as 0, instead of line1.

See also build job https://github.com/amolenaar/MyST-NB/actions/runs/3914854447/jobs/6692383353.

Reproduce the bug

  1. check out Myst-NB
  2. Install `pip install -e '.[testing]'
  3. Run pytest
  4. See stuff fail

List your environment

Python 3.11.1

Shortened pip list:

Package                       Version     Editable project location
----------------------------- ----------- -------------------------------
ipykernel                     5.5.6
ipython                       8.4.0
ipython-genutils              0.2.0
ipywidgets                    8.0.4
jupyter-cache                 0.5.0
jupyter_client                7.4.9
jupyter_core                  5.1.3
jupyter-events                0.6.3
jupyter_server                2.1.0
jupyter-server-mathjax        0.2.6
jupyter_server_terminals      0.4.4
jupyterlab-pygments           0.2.2
jupyterlab-widgets            3.0.5
jupytext                      1.11.5
markdown-it-py                1.1.0
MarkupSafe                    2.1.1
myst-nb                       0.17.1      /home/arjan/Development/MyST-NB
myst-parser                   0.18.1
nbclient                      0.5.13
nbconvert                     7.2.7
nbdime                        3.1.1
nbformat                      5.7.3
pytest                        7.2.0
Sphinx                        5.3.0

amolenaar avatar Jan 13 '23 21:01 amolenaar

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jan 13 '23 21:01 welcome[bot]