jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[tests] `setup.py test` is being deprecated

This fixes discovery issues in commit
4e6ea497d47cafc7f1863103b04e028c1387cd88 and reverts it.

+ fix typo in tests/README.rst

Bug: T243224
Change-Id: I3647a77c46ab9e890c5702e2504cb2831356d754
---
M .appveyor.yml
M .travis.yml
M tests/README.rst
M tox.ini
4 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index a60f3aa..34d4536 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -111,7 +111,7 @@
- ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''wikidata''][''test''] = ''$env:PYWIKIBOT_USERNAME'';')"
- ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''commons''][''commons''] = ''$env:PYWIKIBOT_USERNAME'';')"

- - "%CMD_IN_ENV% coverage run setup.py test"
+ - "%CMD_IN_ENV% coverage run -m unittest discover -vv -p \"*_tests.py\""

on_finish:
- codecov
diff --git a/.travis.yml b/.travis.yml
index 9caf0ec..4605961 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -108,7 +108,7 @@
python setup.py pytest --addopts="-vvv -s --timeout=$TEST_TIMEOUT --cov=. -rsxX" ;
fi
else
- coverage run setup.py test ;
+ coverage run -m unittest discover -vv -p "*_tests.py" ;
fi

after_success:
diff --git a/tests/README.rst b/tests/README.rst
index 56984ec..ec821b9 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -28,10 +28,6 @@

::

- python setup.py test
-
-::
-
python setup.py nosetests --tests tests

::
@@ -44,7 +40,7 @@

::

- python -m unittest -v
+ python -m unittest discover -v -p "*_tests.py"

nose
~~~~
@@ -88,7 +84,7 @@
::

nosetests -v tests.api_tests tests.site_tests
- python -m unittest -v tests.api_tests:TestParamInfo.test_init
+ python -m nose -v tests.api_tests:TestParamInfo.test_init

pytest
~~~~~~
@@ -113,7 +109,7 @@

::

- PYWIKIBOT_TEST_MODULES=api,site python setup.py test
+ PYWIKIBOT_TEST_MODULES=api,site python -m unittest -v


Travis CI
@@ -199,7 +195,7 @@
5. push changes into the forked git repository
6. watch the build at https://circleci.com/gh/<username>/pywikibot

-PYWIKIBOT_NO_USER_CONFIG=2 is needed because 'python setup.py test' is run.
+PYWIKIBOT_NO_USER_CONFIG=2 is needed because 'python -m unittest' is run.

TOXENV=py27,py34 is a workaround because CircleCI runs 'tox',
but there is a bug in the CircleCI default 'py26' implementation.
diff --git a/tox.ini b/tox.ini
index ff2e75e..b0c26f8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -26,7 +26,7 @@
usedevelop = True
commands =
flake8: flake8 --doctests {posargs}
- test: python setup.py test
+ test: python -m unittest discover -vv -p "*_tests.py"

fasttest: python -W error::UserWarning -m generate_user_files -family:wikipedia -lang:test -v
fasttest: nosetests --version

To view, visit change 569362. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3647a77c46ab9e890c5702e2504cb2831356d754
Gerrit-Change-Number: 569362
Gerrit-PatchSet: 4
Gerrit-Owner: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)