scikit-hep/iminuit

1 test fails: pytest.PytestDeprecationWarning: <class 'pytest_black.BlackItem'> is not using a cooperative constructor and only takes {'parent', 'fspath'}.

Closed this issue · 1 comments

cd /usr/ports/math/py-iminuit/work-py39/iminuit-2.25.2 && /usr/bin/env -i HOME=/usr/ports/math/py-iminuit/work-py39  PWD="${PWD}" OSVERSION=1400502 PATH=/usr/local/libexec/ccache:/usr/ports/math/py-iminuit/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin TERM=xterm-256color XDG_DATA_HOME=/usr/ports/math/py-iminuit/work-py39  XDG_CONFIG_HOME=/usr/ports/math/py-iminuit/work-py39  XDG_CACHE_HOME=/usr/ports/math/py-iminuit/work-py39/.cache  HOME=/usr/ports/math/py-iminuit/work-py39 PATH=/usr/local/libexec/ccache:/usr/ports/math/py-iminuit/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/usr/ports/math/py-iminuit/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  " CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHONPATH=/usr/ports/math/py-iminuit/work-py39/stage/usr/local/lib/python3.9/site-packages /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
==================================================================================== test session starts ====================================================================================
platform freebsd14 -- Python 3.9.18, pytest-7.4.4, pluggy-1.4.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/usr/ports/math/py-iminuit/work-py39/iminuit-2.25.2/.hypothesis/examples'))
Using --randomly-seed=3004937261
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /usr/ports/math/py-iminuit/work-py39/iminuit-2.25.2
configfile: pyproject.toml
testpaths: tests
plugins: anyio-4.1.0, hypothesis-6.98.6, datadir-1.5.0, cov-4.1.0, randomly-3.12.0, timeout-2.1.0, time-machine-2.11.0, rerunfailures-11.1.2, flaky-3.7.0, forked-1.6.0, aspectlib-2.0.0, env-0.6.2, mock-3.10.0, black-0.3.12, mypy-0.10.3, checkdocs-2.10.1, flake8-1.1.1, black-multipy-1.0.1, enabler-3.0.0, trio-0.8.0, asyncio-0.22.0, subprocess-1.5.0, typeguard-4.1.5, benchmark-4.0.0
asyncio: mode=strict
collected 0 items / 1 error                                                                                                                                                                 
/usr/local/lib/python3.9/site-packages/coverage/control.py:883: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")

========================================================================================== ERRORS ===========================================================================================
_______________________________________________________________________________ ERROR collecting test session _______________________________________________________________________________
/usr/local/lib/python3.9/site-packages/_pytest/nodes.py:141: in _create
    return super().__call__(*k, **kw)
E   TypeError: __init__() got an unexpected keyword argument 'path'

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/usr/local/lib/python3.9/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/usr/local/lib/python3.9/site-packages/pytest_black.py:27: in pytest_collect_file
    return BlackItem.from_parent(parent, fspath=path)
/usr/local/lib/python3.9/site-packages/_pytest/nodes.py:649: in from_parent
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
/usr/local/lib/python3.9/site-packages/_pytest/nodes.py:264: in from_parent
    return cls._create(parent=parent, **kw)
/usr/local/lib/python3.9/site-packages/_pytest/nodes.py:147: in _create
    warnings.warn(
E   pytest.PytestDeprecationWarning: <class 'pytest_black.BlackItem'> is not using a cooperative constructor and only takes {'parent', 'fspath'}.
E   See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.

-------- coverage: platform freebsd14, python 3.9.18-final-0 ---------
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
src/iminuit/__init__.py                     6      6     0%
src/iminuit/_deprecated.py                 25     25     0%
src/iminuit/_hide_modules.py               27     27     0%
src/iminuit/_optional_dependencies.py      15     15     0%
src/iminuit/_repr_html.py                 118    118     0%
src/iminuit/_repr_text.py                 169    169     0%
src/iminuit/cost.py                       959    959     0%
src/iminuit/experimental.py                 7      7     0%
src/iminuit/minimize.py                    62     62     0%
src/iminuit/minuit.py                    1112   1112     0%
src/iminuit/pdg_format.py                 135    135     0%
src/iminuit/testing.py                     19     19     0%
src/iminuit/typing.py                      43     43     0%
src/iminuit/util.py                       733    733     0%
src/iminuit/warnings.py                     5      5     0%
-----------------------------------------------------------
TOTAL                                    3435   3435     0%

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 1 error in 2.67s ======================================================================================
*** Error code 2

Version: 2.25.2
Python-3.9
FreeBSD 14.0

It seems to be an error in your pytest version. I am not using pytest_black.