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

new pytest version throws deprecation warning #180

Closed
Jasha10 opened this issue Feb 4, 2022 · 3 comments
Closed

new pytest version throws deprecation warning #180

Jasha10 opened this issue Feb 4, 2022 · 3 comments

Comments

@Jasha10
Copy link

Jasha10 commented Feb 4, 2022

Earlier today, pytest v7.0.0 was released.
With this new pytest version installed, running pytest --nbval my_notebook.ipynb throws a deprecation warning:

E   pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
E   See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path

Here is the full traceback for the warning:

.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/pluggy/_hooks.py:265: in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/pluggy/_manager.py:80: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/nbval/plugin.py:117: in pytest_collect_file
    return IPyNbFile.from_parent(parent, fspath=path)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/_pytest/nodes.py:633: in from_parent
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/_pytest/nodes.py:264: in from_parent
    return cls._create(parent=parent, **kw)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/_pytest/nodes.py:140: in _create
    return super().__call__(*k, **kw)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/nbval/plugin.py:206: in __init__
    super(IPyNbFile, self).__init__(*args, **kwargs)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/_pytest/nodes.py:588: in __init__
    path = _imply_path(type(self), path, fspath=fspath)
.nox/test_jupyter_notebooks-3-9/lib/python3.9/site-packages/_pytest/nodes.py:110: in _imply_path
    warnings.warn(
E   pytest.PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
E   See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
@Jasha10
Copy link
Author

Jasha10 commented Aug 18, 2022

This seems to be fixed in recent nbval releases.

@Jasha10
Copy link
Author

Jasha10 commented Nov 15, 2022

Nevermind, I'm still getting this warning with nbval version 0.9.6.

@Jasha10 Jasha10 reopened this Nov 15, 2022
@vidartf
Copy link
Collaborator

vidartf commented Feb 17, 2023

I think this was fixed in 0.10 by #191. If not, please leave a comment and we can reopen!

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

No branches or pull requests

2 participants