tardyp / sphinx-jinja

MIT License
28 stars 22 forks source link

Fix ImportError in tests with Sphinx 7.2 #40

Open mitya57 opened 10 months ago

mitya57 commented 10 months ago

The path class in sphinx.testing.util was a re-export from sphinx.testing.path, but that re-export was removed in https://github.com/sphinx-doc/sphinx/commit/49d830467098cc14.

In the same commit, sphinx.testing.path was deprecated in favor of pathlib. So instead of switching to sphinx.testing.path, switch directly to pathlib for new Sphinx versions.

This fixes the following error:

tests/test_basic.py:7: in <module>
    from sphinx.testing.util import path as Path
E   ImportError: cannot import name 'path' from 'sphinx.testing.util'