From anonymous, 4 Months ago, written in Plain Text.
Embed
  1. py inst-nodeps: /home/florian/proj/pytest/.tox/.tmp/package/1/pytest-6.3.0.dev516+g86af8c79a.d20210624.tar.gz
  2. 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
  3. py run-test-pre: PYTHONHASHSEED='1254752178'
  4. py run-test: commands[0] | pytest testing/test_nodes.py
  5. ============================= test session starts ==============================
  6. platform linux -- Python 3.9.5, pytest-6.3.0.dev516+g86af8c79a.d20210624, py-1.10.0, pluggy-0.13.1
  7. cachedir: .tox/py/.pytest_cache
  8. rootdir: /home/florian/proj/pytest, configfile: pyproject.toml
  9. plugins: hypothesis-6.14.0
  10. collected 17 items
  11.  
  12. testing/test_nodes.py ...........F.....                                  [100%]
  13.  
  14. =================================== FAILURES ===================================
  15. _____________ test_subclassing_both_item_and_collector_deprecated ______________
  16.  
  17. self = <class 'test_nodes.test_subclassing_both_item_and_collector_deprecated.<locals>.SoWrong'>
  18. k = ()
  19. 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')}
  20. 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>}
  21. PytestDeprecationWarning = <class 'pytest.PytestDeprecationWarning'>
  22.  
  23.     def _create(self, *k, **kw):
  24.         try:
  25. >           return super().__call__(*k, **kw)
  26. E           TypeError: __init__() got an unexpected keyword argument 'path'
  27.  
  28. .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:131: TypeError
  29.  
  30. During handling of the above exception, another exception occurred:
  31.  
  32. request = <FixtureRequest for <Function test_subclassing_both_item_and_collector_deprecated>>
  33. tmp_path = PosixPath('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0')
  34.  
  35.     def test_subclassing_both_item_and_collector_deprecated(
  36.         request, tmp_path: Path
  37.     ) -> None:
  38.         """
  39.         Verifies we warn on diamond inheritance
  40.         as well as correctly managing legacy inheritance ctors with missing args
  41.         as found in plugins
  42.         """
  43.    
  44.         with pytest.warns(
  45.             PytestWarning,
  46.             match=(
  47.                 "(?m)SoWrong is an Item subclass and should not be a collector, however its bases File are collectors.\n"
  48.                 "Please split the Collectors and the Item into separate node types.\n.*"
  49.             ),
  50.         ):
  51.    
  52.             class SoWrong(nodes.File, nodes.Item):
  53.                 def __init__(self, fspath, parent):
  54.                     """Legacy ctor with legacy call # don't wana see"""
  55.                     super().__init__(fspath, parent)
  56.    
  57.         with pytest.warns(
  58.             PytestWarning, match=".*SoWrong.* not using a cooperative constructor.*"
  59.         ):
  60. >           SoWrong.from_parent(
  61.                 request.session, fspath=legacy_path(tmp_path / "broken.txt")
  62.             )
  63.  
  64. testing/test_nodes.py:68:
  65. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  66. .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:602: in from_parent
  67.     return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)
  68. .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:252: in from_parent
  69.     return cls._create(parent=parent, **kw)
  70. .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:143: in _create
  71.     return super().__call__(*k, **known_kw)
  72. testing/test_nodes.py:63: in __init__
  73.     super().__init__(fspath, parent)
  74. .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:564: in __init__
  75.     path, fspath = _imply_path(path, fspath=fspath)
  76. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  77.  
  78. path = <Session pytest exitstatus=<ExitCode.OK: 0> testsfailed=0 testscollected=17>
  79. fspath = local('/tmp/pytest-of-florian/pytest-64/test_subclassing_both_item_and0/broken.txt')
  80.  
  81.     def _imply_path(
  82.         path: Optional[Path], fspath: Optional[LEGACY_PATH]
  83.     ) -> Tuple[Path, LEGACY_PATH]:
  84.         if path is not None:
  85.             if fspath is not None:
  86.                 if Path(fspath) != path:
  87. >                   raise ValueError(
  88.                         f"Path({fspath!r}) != {path!r}\n"
  89.                         "if both path and fspath are given they need to be equal"
  90.                     )
  91. 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>
  92. E                   if both path and fspath are given they need to be equal
  93.  
  94. .tox/py/lib/python3.9/site-packages/_pytest/nodes.py:102: ValueError
  95. =========================== short test summary info ============================
  96. FAILED testing/test_nodes.py::test_subclassing_both_item_and_collector_deprecated
  97. ========================= 1 failed, 16 passed in 0.18s =========================
  98. ERROR: InvocationError for command /home/florian/proj/pytest/.tox/py/bin/pytest testing/test_nodes.py (exited with code 1)
  99. ___________________________________ summary ____________________________________
  100. ERROR:   py: commands failed
  101.