summaryrefslogtreecommitdiff
path: root/doc/en/example/assertion/global_testmodule_config/conftest.py
blob: 4859bea78e68f82d953482f1eb9568f210814fd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import pytest
import py

mydir = py.path.local(__file__).dirpath()


def pytest_runtest_setup(item):
    if isinstance(item, pytest.Function):
        if not item.fspath.relto(mydir):
            return
        mod = item.getparent(pytest.Module).obj
        if hasattr(mod, "hello"):
            print("mod.hello %r" % (mod.hello,))