chrisjsewell / pytest-notebook

A pytest plugin for regression testing and regenerating Jupyter Notebooks
https://pytest-notebook.readthedocs.io
BSD 3-Clause "New" or "Revised" License
47 stars 9 forks source link

warning: JupyterNbCollector.from_parent(parent, fspath=path) is depreated #81

Open yellowbean opened 2 months ago

yellowbean commented 2 months ago

Version:

Name: pytest_notebook Version: 0.10.0 Summary: A pytest plugin for testing Jupyter Notebooks.

Message

============================================== warnings summary ============================================== ../../../../opt/homebrew/lib/python3.11/site-packages/pytest_notebook/plugin.py:273 ../../../../opt/homebrew/lib/python3.11/site-packages/pytest_notebook/plugin.py:273 /opt/homebrew/lib/python3.11/site-packages/pytestnotebook/plugin.py:273: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. Please use the (path: pathlib.Path) argument instead._ See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path return JupyterNbCollector.from_parent(parent, fspath=path)

absbox/tests/test_regression.py::test_resp /opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py:1056: InsecureRequestWarning: Unverified HTTPS request is being made to host '127.0.0.1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Propose

Do you think we can use the path of JupyterNbCollector instead of fspath ?

ibressler commented 2 months ago

I confirm, getting this here as well with pytest. Line 273 in plugin.py should be changed.