jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/704096 )
Change subject: [tests] Remove PYWIKIBOT_NO_L10N_TESTS environment variable ......................................................................
[tests] Remove PYWIKIBOT_NO_L10N_TESTS environment variable
l10n tests are exected by Jenkins for each patch submitted to pywikibot-i18n. pywikibot-core should not run this tests to decrease test time.
For unittests l10n is excuded in tests.collector already because i18n is part of disabled_test_modules.
Travis (as well as fasttests) may run pytest. Therefore add addopts command line to tox.ini to exclude the l10n tests with pytest.
Finally we can remove PYWIKIBOT_NO_L10N_TESTS environment variable
Change-Id: I8097a7b16c79ef6c0ba54c92890a2cc6beb43a15 --- M .appveyor.yml M .travis.yml M tests/l10n_tests.py M tox.ini 4 files changed, 1 insertion(+), 9 deletions(-)
Approvals: JJMC89: Looks good to me, approved jenkins-bot: Verified
diff --git a/.appveyor.yml b/.appveyor.yml index 0f9f65a..f5b9cfc 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -9,7 +9,6 @@ PYWIKIBOT_PASSWD_FILE: "%appdata%\Pywikibot\passwordfile"
PYSETUP_TEST_EXTRAS: "1" - PYWIKIBOT_NO_L10N_TESTS: "1" PYWIKIBOT_TESTS_RUNNING: "1"
matrix: diff --git a/.travis.yml b/.travis.yml index d072ed9..0eba46e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -118,7 +118,6 @@ env: global: - TEST_TIMEOUT=300 - - PYWIKIBOT_NO_L10N_TESTS=1 - PYWIKIBOT_TESTS_RUNNING=1
matrix: diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py index e3f2b4e..820f5d6 100644 --- a/tests/l10n_tests.py +++ b/tests/l10n_tests.py @@ -4,7 +4,6 @@ # # Distributed under the terms of the MIT license. # -import os import unittest from contextlib import suppress
@@ -121,12 +120,6 @@ .format(key))
-def setUpModule(): # noqa: N802 - """Skip Travis tests if PYWIKIBOT_NO_L10N_TESTS variable is set.""" - if os.environ.get('PYWIKIBOT_NO_L10N_TESTS', '0') == '1': - raise unittest.SkipTest('L10N tests disabled.') - - if __name__ == '__main__': # pragma: no cover with suppress(SystemExit): unittest.main() diff --git a/tox.ini b/tox.ini index 76f2922..22fcbe1 100644 --- a/tox.ini +++ b/tox.ini @@ -230,5 +230,6 @@ minversion = 5.3 testpaths = tests python_files = *_tests.py +addopts = --ignore=tests/l10n_tests.py norecursedirs = archive filterwarnings = ignore::pytest.PytestDeprecationWarning
pywikibot-commits@lists.wikimedia.org