summaryrefslogtreecommitdiff
path: root/conftest.py
blob: bd9f2d32d276a6ab30781d4d4b9b49d0a0faa498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from _pytest.doctest import DoctestModule
from py.path import local

collect_ignore = ['tests/messages/data', 'setup.py']
babel_path = local(__file__).dirpath().join('babel')


def pytest_collect_file(path, parent):
    if babel_path.common(path) == babel_path:
        if path.ext == ".py":
            # TODO: remove check when dropping support for old Pytest
            if hasattr(DoctestModule, "from_parent"):
                return DoctestModule.from_parent(parent, fspath=path)
            return DoctestModule(path, parent)