]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
run the right test suite by default
authorAlex Morega <alex@grep.ro>
Sat, 6 Jul 2013 15:16:58 +0000 (17:16 +0200)
committerAlex Morega <alex@grep.ro>
Sat, 6 Jul 2013 15:17:55 +0000 (17:17 +0200)
Makefile
conftest.py
setup.cfg
tox.ini

index 27a1377ecb3ae05baa3d7131f91ea724c795032c..6bd85277e131d32c72c1eecf5f846e6d2391bea4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 test: import-cldr
-       @py.test tests
+       @py.test
 
 clean: clean-cldr clean-pyc
 
index e0b442621ddc3a42d7b315ac612b2ff9ff7b1c52..55e27a2cad3d371b29c195134eb7a579ce175268 100644 (file)
@@ -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)
index 01bb954499e4eebf51604784cd75a64aa82b7b5a..18b3ebada72d81d9c23b8f87e21d15eaca490dd5 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,6 @@
 [egg_info]
 tag_build = dev
 tag_svn_revision = true
+
+[pytest]
+norecursedirs = .* _* scripts {args}
diff --git a/tox.ini b/tox.ini
index 35672857f01ac844a0e6916d1b33bb9d40499ed0..0059112fcc2c093ef27aeda377ab3ebdb84a9d4e 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -5,4 +5,4 @@ envlist = py26, py27, pypy, py33
 deps =
     pytz
     pytest
-commands = py.test tests []
+commands = py.test []