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

Errors under pytest 8.0.0: A) The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. B) PermissionError: [Errno 13] Permission denied #73

Open
amotl opened this issue Jan 29, 2024 · 2 comments

Comments

@amotl
Copy link
Contributor

amotl commented Jan 29, 2024

Dear Chris,

when updating to pytest 8.0.0, released two days ago, through a corresponding PR submitted by Dependabot, ...

.... CI fails like:

ERROR tests/testdata/folder - pytest.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
ERROR tests/testdata/snippet - pytest.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

-- https://github.com/pyveci/pueblo/actions/runs/7701648260/job/20988180571?pr=63#step:5:154

This documentation probably has corresponding guidelines.

With kind regards,
Andreas.

@amotl
Copy link
Contributor Author

amotl commented Jan 29, 2024

While the previous report was coming from a downstream project, when switching to this one, the issue can be reproduced like that:

pytest -vvv tests/test_plugin_collector.py

The outcome is:

FAILED tests/test_plugin_collector.py::test_collection - Failed: nomatch: '*<JupyterNbCollector*test_nb.ipynb>*'
FAILED tests/test_plugin_collector.py::test_setup_with_skip_meta - Failed: nomatch: '*test_nb.ipynb*s*'
FAILED tests/test_plugin_collector.py::test_run_fail - Failed: nomatch: '*::nbregression(test_nb) FAILED*'
FAILED tests/test_plugin_collector.py::test_run_pass_with_meta - Failed: nomatch: '*::nbregression(test_nb) PASSED*'

@amotl
Copy link
Contributor Author

amotl commented Jan 29, 2024

GH-74 partly fixes the problem, i.e. both tests test_collection and test_setup_with_skip_meta. The other two test cases wierdly error out like that, and I can't discover anything how to fix this.

/path/to/.venv/lib/python3.11/site-packages/pluggy/_hooks.py:493: in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
/path/to/.venv/lib/python3.11/site-packages/pluggy/_manager.py:115: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/path/to/.venv/lib/python3.11/site-packages/pluggy/_manager.py:457: in traced_hookexec
    return outcome.get_result()
/path/to/.venv/lib/python3.11/site-packages/pluggy/_manager.py:454: in <lambda>
    lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
/path/to/.venv/lib/python3.11/site-packages/_pytest/python.py:210: in pytest_collect_directory
    if pkginit.is_file():
/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py:1267: in is_file
    return S_ISREG(self.stat().st_mode)
/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py:1013: in stat
    return os.stat(self, follow_symlinks=follow_symlinks)
E   PermissionError: [Errno 13] Permission denied: '/private/var/audit/__init__.py'
=========================== short test summary info ============================
ERROR ../../../../../../../../../Users/amo/dev/pyveci/sources/pytest-notebook/::private::var

Same on CI:

________________________ ERROR collecting test session _________________________
/path/to/lib/python3.8/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/path/to/lib/python3.8/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/path/to/lib/python3.8/site-packages/pluggy/_manager.py:473: in traced_hookexec
    return outcome.get_result()
/path/to/lib/python3.8/site-packages/pluggy/_manager.py:470: in <lambda>
    lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
/path/to/lib/python3.8/site-packages/_pytest/python.py:210: in pytest_collect_directory
    if pkginit.is_file():
/path/to/lib/python3.8/pathlib.py:1439: in is_file
    return S_ISREG(self.stat().st_mode)
/path/to/lib/python3.8/pathlib.py:1198: in stat
    return self._accessor.stat(self)
E   PermissionError: [Errno 13] Permission denied: '/tmp/snap-private-tmp/__init__.py'
=========================== short test summary info ============================
ERROR ../../../../home/runner/work/pytest-notebook/pytest-notebook/::tmp - PermissionError: [Errno 13] Permission denied: '/tmp/snap-private-tmp/__init__.py'

-- https://github.com/chrisjsewell/pytest-notebook/actions/runs/7702860395/job/20992040778?pr=74#step:5:264

@amotl amotl changed the title ERROR under pytest 8.0.0: The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. Errors under pytest 8.0.0: 1. The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. 2. PermissionError: [Errno 13] Permission denied Jan 29, 2024
@amotl amotl changed the title Errors under pytest 8.0.0: 1. The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. 2. PermissionError: [Errno 13] Permission denied Errors under pytest 8.0.0: A) The (fspath: py.path.local) argument to JupyterNbCollector is deprecated. B) PermissionError: [Errno 13] Permission denied Jan 29, 2024
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

1 participant