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)
|
|
|
|
|
|
|
|
|
2021-12-03 20:14:09 +08:00
|
|
|
def pytest_collect_file(file_path, parent):
|
|
|
|
return CustomFile.from_parent(path=file_path, parent=parent)
|