2018-08-01 04:50:55 +08:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
2020-07-23 08:36:51 +08:00
|
|
|
class CustomItem(pytest.Item):
|
2018-08-01 04:50:55 +08:00
|
|
|
def runtest(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2020-07-23 08:36:51 +08:00
|
|
|
class CustomFile(pytest.File):
|
|
|
|
def collect(self):
|
|
|
|
yield CustomItem.from_parent(name="foo", parent=self)
|
|
|
|
|
|
|
|
|
2018-08-01 04:50:55 +08:00
|
|
|
def pytest_collect_file(path, parent):
|
2020-07-23 08:36:51 +08:00
|
|
|
return CustomFile.from_parent(fspath=path, parent=parent)
|