File: conftest.py

package info (click to toggle)
python-babel 2.8.0%2Bdfsg.1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 194,932 kB
  • sloc: xml: 2,069,184; python: 12,072; makefile: 197; sh: 36
file content (13 lines) | stat: -rw-r--r-- 463 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
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":
            if hasattr(DoctestModule, "from_parent"):
                return DoctestModule.from_parent(parent, fspath=path)
            return DoctestModule(path, parent)