From: Aarni Koskela Date: Sun, 20 Dec 2015 22:43:39 +0000 (+0200) Subject: Test/CI: Add requisite doctest flags; ignore setup.py and venvs X-Git-Tag: 2.2.0~10^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ab038fb0556d20788397a450f52f6cd6e94b6c7;p=thirdparty%2Fbabel.git Test/CI: Add requisite doctest flags; ignore setup.py and venvs This requires a newer version of py.test, so the requirement is pinned in the CI configuration. See https://pytest.org/latest/doctest.html See https://pytest.org/latest/example/pythoncollection.html#customizing-test-collection-to-find-all-py-files --- diff --git a/.ci/appveyor.yml b/.ci/appveyor.yml index 67ca84b1..5a9fd008 100644 --- a/.ci/appveyor.yml +++ b/.ci/appveyor.yml @@ -43,7 +43,8 @@ install: - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" # Build data files - - "pip install . pytest" + - "pip install --upgrade pytest==2.8.5" + - "pip install --editable ." - "python setup.py import_cldr" build: false # Not a C# project, build stuff at the test step instead. diff --git a/.gitignore b/.gitignore index 0006e76c..7c27f0e6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ babel/global.dat tests/messages/data/project/i18n/long_messages.pot tests/messages/data/project/i18n/temp.pot tests/messages/data/project/i18n/en_US +/venv* diff --git a/.travis.yml b/.travis.yml index d25ad5f2..7bf5e9c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ sudo: false cache: directories: - cldr + - "$HOME/.cache/pip" matrix: include: @@ -75,7 +76,7 @@ matrix: install: - bash .ci/deps.${TRAVIS_OS_NAME}.sh - pip install --upgrade pip - - pip install --allow-external cdecimal pytest pytest-cov $CDECIMAL + - pip install --allow-external cdecimal --upgrade pytest==2.8.5 pytest-cov==2.2.0 $CDECIMAL - pip install --editable . script: diff --git a/conftest.py b/conftest.py index 55e27a2c..15a589a6 100644 --- a/conftest.py +++ b/conftest.py @@ -6,7 +6,7 @@ from py.path import local PY2 = sys.version_info[0] < 3 -collect_ignore = ['tests/messages/data'] +collect_ignore = ['tests/messages/data', 'setup.py'] def pytest_collect_file(path, parent): diff --git a/setup.cfg b/setup.cfg index 38a441db..8069749f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,8 @@ release = sdist bdist_wheel [pytest] -norecursedirs = .* _* scripts {args} +norecursedirs = venv* .* _* scripts {args} +doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE ALLOW_UNICODE [bdist_wheel] universal = 1