2020-07-27 08:56:06 +08:00
|
|
|
import os.path
|
2018-05-23 22:48:46 +08:00
|
|
|
|
2018-10-25 15:01:29 +08:00
|
|
|
import pytest
|
|
|
|
|
2020-07-27 08:56:06 +08:00
|
|
|
mydir = os.path.dirname(__file__)
|
2009-09-11 18:05:06 +08:00
|
|
|
|
2018-05-23 22:48:46 +08:00
|
|
|
|
2009-09-11 18:05:06 +08:00
|
|
|
def pytest_runtest_setup(item):
|
2010-11-13 16:05:11 +08:00
|
|
|
if isinstance(item, pytest.Function):
|
2009-11-24 22:16:58 +08:00
|
|
|
if not item.fspath.relto(mydir):
|
|
|
|
return
|
2010-11-13 16:05:11 +08:00
|
|
|
mod = item.getparent(pytest.Module).obj
|
2018-05-23 22:48:46 +08:00
|
|
|
if hasattr(mod, "hello"):
|
2018-08-23 09:30:42 +08:00
|
|
|
print("mod.hello {!r}".format(mod.hello))
|