Skip to content

Tests which use the sphinx_run fixture are broken for sphinx>7; failing CI results #545

@peytondmurray

Description

@peytondmurray

Context

Currently, tests are failing on CI:

image

Expectation

Tests should pass.

Bug

The tests are failing with the following message:

==================================== ERRORS ====================================
_____________________ ERROR at setup of test_codecell_file _____________________
file /home/runner/work/MyST-NB/MyST-NB/tests/test_codecell_file.py, line 6
  @pytest.mark.sphinx_params(
      "mystnb_codecell_file.md",
      conf={"nb_execution_mode": "cache", "source_suffix": {".md": "myst-nb"}},
  )
  def test_codecell_file(sphinx_run, file_regression, check_nbs, get_test_path):
file /home/runner/work/MyST-NB/MyST-NB/tests/conftest.py, line 150
  @pytest.fixture()
  def sphinx_run(sphinx_params, make_app, tempdir):
E       fixture 'tempdir' not found
>       available fixtures: _shared_result_cache, anyio_backend, anyio_backend_name, anyio_backend_options, app, app_params, build_matplotlib_font_cache, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, check_nbs, clean_doctree, cov, data_regression, datadir, dataframe_regression, doctest_namespace, file_regression, get_test_path, if_graphviz_found, image_regression, make_app, monkeypatch, ndarrays_regression, no_cover, num_regression, original_datadir, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, rollback_sysmodules, rootdir, shared_datadir, shared_result, sphinx_params, sphinx_run, sphinx_test_tempdir, status, test_params, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, warning
>       use 'pytest --fixtures [testpath]' for help on them.

This happens because the sphinx_run fixture provided by myst-nb relies on a tempdir fixture provided by Sphinx that appears to have been removed some time between 6.2.1 and 7.2.6.

Problem

This is a problem because this seems to be a release blocker, and as such it is blocking people from upgrading sphinx:

Reproduce the bug

  1. Clone the repo
  2. pip install .[testing]
  3. pytest

List your environment

This is currently affecting environments with python>3.8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions