conftest.py 533 B

1234567891011121314
  1. from _pytest.doctest import DoctestModule
  2. from py.path import local
  3. collect_ignore = ['tests/messages/data', 'setup.py']
  4. babel_path = local(__file__).dirpath().join('babel')
  5. def pytest_collect_file(path, parent):
  6. if babel_path.common(path) == babel_path:
  7. if path.ext == ".py":
  8. # TODO: remove check when dropping support for old Pytest
  9. if hasattr(DoctestModule, "from_parent"):
  10. return DoctestModule.from_parent(parent, fspath=path)
  11. return DoctestModule(path, parent)