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 (Setting minthrottle = 0, maxthrottle = 1 in the user-config made the tests run in a reasonable time).
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