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:
@@ -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)
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user