Tobias1984 created this task.
Tobias1984 added a project: Pywikibot-tests.
Herald added subscribers: pywikibot-bugs-list, Zppix, Aklapper.

TASK DESCRIPTION

I am currently attempting to get more tests to run with pytest and think we need to make it more convenient to use pytest. Ideally all tests should run after cloning the repository without any further setup.

By default most tests will skip because they involve editing test.wikidata.org. So instead of just typing

$ pytest tests/wikibase_edit_tests.py

the user needs to pass the correct environment variable:

$ ENV_NAME='testing' PYWIKIBOT2_TEST_WRITE=1 python3 -m pytest tests/wikibase_edit_tests.py

But even then the tests run painfully slow, because the bot will use the sleep times in the user-config instead of using lower sleep-times for testing. So it would also be good to make separate settings when running tests.

For those people that would like to help with the pytest compatibility, just choose a group of tests and run:

$ ENV_NAME='testing' PYWIKIBOT2_TEST_WRITE=1 python3 -m pytest tests/wikibase_edit_tests.py -rxs --maxfail=1

TASK DETAIL
https://phabricator.wikimedia.org/T139847

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Tobias1984
Cc: Aklapper, Zppix, Tobias1984, pywikibot-bugs-list
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to