summaryrefslogtreecommitdiff
path: root/conftest.py
diff options
context:
space:
mode:
authorAlex Morega <alex@grep.ro>2013-07-06 17:16:58 +0200
committerAlex Morega <alex@grep.ro>2013-07-06 17:17:55 +0200
commit75752cd1ddfe417d1ba448eeacc26d2801a93d43 (patch)
tree3a54971da6d06c07238562268f5f3cfcaa3fb4fc /conftest.py
parent2a45afc078647858857c8238f2effd928b1f0371 (diff)
downloadbabel-75752cd1ddfe417d1ba448eeacc26d2801a93d43.tar.gz
run the right test suite by default
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/conftest.py b/conftest.py
index e0b4426..55e27a2 100644
--- a/conftest.py
+++ b/conftest.py
@@ -1,6 +1,18 @@
+import sys
+from _pytest.doctest import DoctestModule
+from py.path import local
+
+
+PY2 = sys.version_info[0] < 3
+
+
collect_ignore = ['tests/messages/data']
-def pytest_configure(config):
- import sys
- if sys.version_info[0] < 3:
- config.option.doctestmodules = True
+
+def pytest_collect_file(path, parent):
+ babel_path = local(__file__).dirpath().join('babel')
+ config = parent.config
+ if PY2:
+ if babel_path.common(path) == babel_path:
+ if path.ext == ".py":
+ return DoctestModule(path, parent)