Skip to content

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

Closed
shuuji3 wants to merge 1 commit intosphinx-doc:mainfrom
shuuji3:test/fix-deprecation-warning-with-pathlib
Closed

test: fix deprecation warning about path by using suggested Pathlib#111
shuuji3 wants to merge 1 commit intosphinx-doc:mainfrom
shuuji3:test/fix-deprecation-warning-with-pathlib

Conversation

@shuuji3
Copy link
Copy Markdown
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
Copy Markdown
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
@shuuji3 shuuji3 deleted the test/fix-deprecation-warning-with-pathlib branch April 3, 2025 04:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant