Xqt submitted this change.

View Change

Approvals: jenkins-bot: Verified Xqt: Verified; Looks good to me, approved
[tests] use pytest for doctest

- nosetest is not maintained any longer and fails with Python 3.10+.
Use pytest instead for doctest.
- require pytest 7.0.1 or higher
- remove pytest filterwarnings because it was dropped in pytest 6.1.

Bug: T319164
Change-Id: I8e5d65c6784070c8a0376386dd45993fd245c207
---
M dev-requirements.txt
M tox.ini
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/dev-requirements.txt b/dev-requirements.txt
index 48d6783..8f204bf 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,7 +1,7 @@
# This is a PIP 6+ requirements file for development dependencies
#

-pytest >= 5.3
+pytest >= 7.0.1
pytest-cov >= 3.0.0; python_version>="3.10"
pytest-cov >= 2.11.1; python_version<"3.10"
pytest-timeout
diff --git a/tox.ini b/tox.ini
index f852f3e..c8a676b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,10 @@
hacking-py37

[params]
-doctest_skip = --ignore-files=(gui|memento)\.py
+# gui needs tkinter
+doctest_skip =
+ --ignore-glob="*gui.py"
+ --ignore-glob="*memento.py"
exclude = --exclude make_dist.py,.tox,.git,./*.egg,build,./scripts/i18n/*
generate_user_files = -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v

@@ -41,7 +44,7 @@
flake8: .[flake8]
hacking: .[hacking]

- fasttest: pytest >= 5.3
+ fasttest: pytest >= 7.0.1
fasttest: pytest-attrib>=0.1.3
fasttest: pytest-subtests >= 0.3.2
fasttest: mock
@@ -65,10 +68,10 @@
basepython = python3
commands =
python {[params]generate_user_files}
- nosetests --version
- nosetests -v --with-doctest pywikibot {[params]doctest_skip}
+ pytest --version
+ pytest pywikibot --doctest-modules {[params]doctest_skip}
deps =
- nose
+ pytest >= 7.0.1
.[eventstreams]
.[mwparserfromhell]
.[mysql]
@@ -232,8 +235,7 @@
ignore = D105,D211

[pytest]
-minversion = 5.3
+minversion = 7.0.1
testpaths = tests
python_files = *_tests.py
addopts = --ignore=tests/l10n_tests.py
-filterwarnings = ignore::pytest.PytestDeprecationWarning

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8e5d65c6784070c8a0376386dd45993fd245c207
Gerrit-Change-Number: 837616
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged