- py inst-nodeps: /home/florian/proj/pytest/.tox/.tmp/package/1/pytest-6.3.0.dev516+g86af8c79a.d20210624.tar.gz
- py installed: argcomplete==1.12.3,attrs==21.2.0,certifi==2021.5.30,chardet==4.0.0,elementpath==2.2.3,hypothesis==6.14.0,idna==2.10,iniconfig==1.1.1,mock==4.0.3,nose==1.3.7,packaging==20.9,pluggy==0.13.1,py==1.10.0,Pygments==2.9.0,pyparsing==2.4.7,pytest @ file:///home/florian/proj/pytest/.tox/.tmp/package/1/pytest-6.3.0.dev516%2Bg86af8c79a.d20210624.tar.gz,requests==2.25.1,sortedcontainers==2.4.0,toml==0.10.2,urllib3==1.26.5,xmlschema==1.6.4
- py run-test-pre: PYTHONHASHSEED='1254752178'
- py run-test: commands[0] | pytest testing/test_nodes.py
- ============================= test session starts ==============================
- platform linux -- Python 3.9.5, pytest-6.3.0.dev516+g86af8c79a.d20210624, py-1.10.0, pluggy-0.13.1
- cachedir: .tox/py/.pytest_cache
- rootdir: /home/florian/proj/pytest, configfile: pyproject.toml
- plugins: hypothesis-6.14.0
- collected 17 items
- testing/test_nodes.py ...........F..... [100%]
- =================================== FAILURES ===================================
- _____________ test_subclassing_both_item_and_collector_deprecated ______________
- self = <class 'test_nodes.test_subclassing_both_item_and_collector_deprecated.<locals>.SoWrong'>
- k = ()
- kw = {'fspath': local('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0/broken.txt'), 'parent': <Session py...0 testscollected=17>, 'path': PosixPath('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0/broken.txt')}
- known_kw = {'fspath': local('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0/broken.txt'), 'parent': <Session pytest exitstatus=<ExitCode.OK: 0> testsfailed=0 testscollected=17>}
- PytestDeprecationWarning = <class 'pytest.PytestDeprecationWarning'>
- def _create(self, *k, **kw):
- try:
- > return super().__call__(*k, **kw)
- E TypeError: __init__() got an unexpected keyword argument 'path'
- .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:131: TypeError
- During handling of the above exception, another exception occurred:
- request = <FixtureRequest for <Function test_subclassing_both_item_and_collector_deprecated>>
- tmp_path = PosixPath('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0')
- def test_subclassing_both_item_and_collector_deprecated(
- request, tmp_path: Path
- ) -> None:
- """
- Verifies we warn on diamond inheritance
- as well as correctly managing legacy inheritance ctors with missing args
- as found in plugins
- """
- with pytest.warns(
- PytestWarning,
- match=(
- "(?m)SoWrong is an Item subclass and should not be a collector, however its bases File are collectors.\n"
- "Please split the Collectors and the Item into separate node types.\n.*"
- ),
- ):
- class SoWrong(nodes.File, nodes.Item):
- def __init__(self, fspath, parent):
- """Legacy ctor with legacy call # don't wana see"""
- super().__init__(fspath, parent)
- with pytest.warns(
- PytestWarning, match=".*SoWrong.* not using a cooperative constructor.*"
- ):
- > SoWrong.from_parent(
- request.session, fspath=legacy_path(tmp_path / "broken.txt")
- )
- testing/test_nodes.py:68:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:602: in from_parent
- return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
- .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:252: in from_parent
- return cls._create(parent=parent, **kw)
- .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:143: in _create
- return super().__call__(*k, **known_kw)
- testing/test_nodes.py:63: in __init__
- super().__init__(fspath, parent)
- .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:564: in __init__
- path, fspath = _imply_path(path, fspath=fspath)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- path = <Session pytest exitstatus=<ExitCode.OK: 0> testsfailed=0 testscollected=17>
- fspath = local('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0/broken.txt')
- def _imply_path(
- path: Optional[Path], fspath: Optional[LEGACY_PATH]
- ) -> Tuple[Path, LEGACY_PATH]:
- if path is not None:
- if fspath is not None:
- if Path(fspath) != path:
- > raise ValueError(
- f"Path({fspath!r}) != {path!r}\n"
- "if both path and fspath are given they need to be equal"
- )
- E ValueError: Path(local('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0/broken.txt')) != <Session pytest exitstatus=<ExitCode.OK: 0> testsfailed=0 testscollected=17>
- E if both path and fspath are given they need to be equal
- .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:102: ValueError
- =========================== short test summary info ============================
- FAILED testing/test_nodes.py::test_subclassing_both_item_and_collector_deprecated
- ========================= 1 failed, 16 passed in 0.18s =========================
- ERROR: InvocationError for command /home/florian/proj/pytest/.tox/py/bin/pytest testing/test_nodes.py (exited with code 1)
- ___________________________________ summary ____________________________________
- ERROR: py: commands failed