From: Alex Morega Date: Sat, 6 Jul 2013 15:16:58 +0000 (+0200) Subject: run the right test suite by default X-Git-Tag: 1.0~87^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75752cd1ddfe417d1ba448eeacc26d2801a93d43;p=thirdparty%2Fbabel.git run the right test suite by default --- diff --git a/Makefile b/Makefile index 27a1377e..6bd85277 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ test: import-cldr - @py.test tests + @py.test clean: clean-cldr clean-pyc diff --git a/conftest.py b/conftest.py index e0b44262..55e27a2c 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) diff --git a/setup.cfg b/setup.cfg index 01bb9544..18b3ebad 100644 --- 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 35672857..0059112f 100644 --- 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 []