Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix deprecation warning about path by using suggested Pathlib #111

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shuuji3
Copy link
Contributor

@shuuji3 shuuji3 commented Sep 12, 2023

I saw the following deprecation warning when running the tests on local:

> pipx run nox -s test
nox > Running session test
nox > Re-using existing virtual environment at .nox/test.
nox > python -m pip install -e .
nox > python -m pip install -r dev-requirements.txt
nox > pytest
=============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.11.5, pytest-7.1.3, pluggy-1.3.0
rootdir: /Users/shuuji3/dev/sphinxext-opengraph
collected 37 items

tests/test_options.py ..........s..........................                                                                                                                 [100%]

================================================================================ warnings summary =================================================================================
tests/conftest.py:3
  /Users/shuuji3/dev/sphinxext-opengraph/tests/conftest.py:3: RemovedInSphinx90Warning: 'sphinx.testing.path' is deprecated. Use 'os.path' or 'pathlib' instead.
    from sphinx.testing.path import path

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================== 36 passed, 1 skipped, 1 warning in 1.67s =====================================================================
nox > Session test was successful.

This was introduced by the recent changes, so I don't think it is an urgent one.

ref. Changelog — Sphinx documentation - https://www.sphinx-doc.org/en/master/changes.html#release-7-2-0-released-aug-17-2023

When running the tests, I saw the following deprecation warning:

```shell
> pipx run nox -s test
nox > Running session test
nox > Re-using existing virtual environment at .nox/test.
nox > python -m pip install -e .
nox > python -m pip install -r dev-requirements.txt
nox > pytest
=============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.11.5, pytest-7.1.3, pluggy-1.3.0
rootdir: /Users/shuuji3/dev/sphinxext-opengraph
collected 37 items

tests/test_options.py ..........s..........................                                                                                                                 [100%]

================================================================================ warnings summary =================================================================================
tests/conftest.py:3
  /Users/shuuji3/dev/sphinxext-opengraph/tests/conftest.py:3: RemovedInSphinx90Warning: 'sphinx.testing.path' is deprecated. Use 'os.path' or 'pathlib' instead.
    from sphinx.testing.path import path

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================== 36 passed, 1 skipped, 1 warning in 1.67s =====================================================================
nox > Session test was successful.
```
@shuuji3
Copy link
Contributor Author

shuuji3 commented Sep 13, 2023

OK, it seems that this change affects many places of tests run on the GitHub Actions. This needs to be investigated.

@shuuji3 shuuji3 marked this pull request as draft September 13, 2023 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant