jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[test] move doctest_skip to pytest command

Tox v4 does not concatenate multiple lines when doing variable
substitution from another section hence the config:

[params]
doctest_skip =
--ignore-glob="*gui.py"
--ignore-glob="*memento.py"

When used in a commands with `pytest {[params]doctest_skip}` results in
tox 4 generating the commands:

1) pytest '--ignore-glob="*gui.py"'
2) '--ignore-glob="*memento.py"'

The `doctest_skip` variable uses multiple lines since 3b392ab2819. The
parameter substitution comes from 2014 commit c55ea2f9aec which
introduced `nose_skip` (later renamed `doctest_skip`).

Since the `doctest_skip` parameter is only substitued once, move it to
the pytest doctest command.

With tox 3 (I have added new lines to the lists):

$ tox -e doctest --showconf
...
[testenv:doctest]
commands = [
['python', '-W', 'error::UserWarning', '-m', 'pwb',
'generate_user_files', '-family:wikipedia', '-lang:test', '-v'],
['pytest', '--version'],
['pytest', 'pywikibot', '--doctest-modules',
'--ignore-glob=*gui.py', '--ignore-glob=*memento.py']
]

With tox 4:

$ tox config -e doctest -k commands
[testenv:doctest]
commands =
python -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v
pytest --version
pytest pywikibot --doctest-modules '--ignore-glob=*gui.py' '--ignore-glob=*memento.py'

Bug: T345695
Change-Id: Ic92e1ae2996e734431706242ffbc86dd7f6ff633
---
M tox.ini
1 file changed, 59 insertions(+), 5 deletions(-)

diff --git a/tox.ini b/tox.ini
index 9b2d999..beaa8d2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,10 +9,8 @@
hacking-{py36,py39}

[params]
-# gui needs tkinter
-doctest_skip =
- --ignore-glob="*gui.py"
- --ignore-glob="*memento.py"
+# Note: tox 4 does not support multiple lines when doing parameters
+# substitution.
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

@@ -73,7 +71,10 @@
commands =
python {[params]generate_user_files}
pytest --version
- pytest pywikibot --doctest-modules {[params]doctest_skip}
+# gui.py needs tkinter
+# memento.py has too many timeout
+ pytest pywikibot --doctest-modules --ignore-glob="*gui.py" --ignore-glob="*memento.py"
+
deps =
pytest >= 7.0.1
.[eventstreams]

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ic92e1ae2996e734431706242ffbc86dd7f6ff633
Gerrit-Change-Number: 960006
Gerrit-PatchSet: 2
Gerrit-Owner: Hashar <hashar@free.fr>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged