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

7.1.2: black warnings on pytest code #9954

Closed
kloczek opened this issue May 13, 2022 · 3 comments
Closed

7.1.2: black warnings on pytest code #9954

kloczek opened this issue May 13, 2022 · 3 comments

Comments

@kloczek
Copy link
Contributor

kloczek commented May 13, 2022

Looks like black shows some warnings on pytets code when I'm testing dask-sphinx-theme module (https://github.com/dask/dask-sphinx-theme/)

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-dask-sphinx-theme-2.0.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-dask-sphinx-theme-2.0.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --black
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/dask-sphinx-theme-2.0.3
plugins: cov-3.0.0, black-0.3.12
collected 4 items

setup.py .                                                                                                                                                           [ 25%]
dask_sphinx_theme/__init__.py .                                                                                                                                      [ 50%]
dask_sphinx_theme/ext/dask_config_sphinx_ext.py .                                                                                                                    [ 75%]
docs/conf.py .                                                                                                                                                       [100%]

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:146
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:146
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:146
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:146
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:146: PytestDeprecationWarning: <class 'pytest_black.BlackItem'> is not using a cooperative constructor and only takes {'fspath', 'parent'}.
  See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.
    warnings.warn(

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:264
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:264
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:264
../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:264
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:264: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to BlackItem 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 cls._create(parent=parent, **kw)

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:708
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:708: PytestWarning: BlackItem is an Item subclass and should not be a collector, however its bases File are collectors.
  Please split the Collectors and the Item into separate node types.
  Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html
  example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================== 4 passed, 9 warnings in 0.95s =======================================================================
@RonnyPfannschmidt
Copy link
Member

Report to wrong project

@The-Compiler
Copy link
Member

Already reported here FWIW: shopkeep/pytest-black#55

@kloczek
Copy link
Contributor Author

kloczek commented May 13, 2022

Ups sorry 😃
Thank you to let me know that it is already opened 👍

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

3 participants