Change pytest deprecation warnings into errors for 6.0 release (#7362)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
This commit is contained in:
Bruno Oliveira
2020-07-22 21:36:51 -03:00
committed by GitHub
parent a9799f0b35
commit 7ec6401ffa
19 changed files with 122 additions and 84 deletions

View File

@@ -1,10 +1,15 @@
import pytest
class CustomItem(pytest.Item, pytest.File):
class CustomItem(pytest.Item):
def runtest(self):
pass
class CustomFile(pytest.File):
def collect(self):
yield CustomItem.from_parent(name="foo", parent=self)
def pytest_collect_file(path, parent):
return CustomItem(path, parent)
return CustomFile.from_parent(fspath=path, parent=parent)

View File

@@ -3,11 +3,11 @@ import pytest
class MyFile(pytest.File):
def collect(self):
return [MyItem("hello", parent=self)]
return [MyItem.from_parent(name="hello", parent=self)]
def pytest_collect_file(path, parent):
return MyFile(path, parent)
return MyFile.from_parent(fspath=path, parent=parent)
class MyItem(pytest.Item):