Open albertvillanova opened 5 years ago
For the moment, to avoid this error, pytets capturing must be disabled:
pytest -s
$ ./run_tests.sh
============================= test session starts =============================
platform win32 -- Python 3.7.5, pytest-5.2.2, py-1.8.0, pluggy-0.13.0
rootdir: C:\Users\AVI14827\projects\wikidata\WikidataBot
collected 1 item
tests\test_sample.py .
============================== 1 passed in 0.40s ==============================
CRITICAL: Exiting due to uncaught exception None
Note the last line, logged by pywikibot:
CRITICAL: Exiting due to uncaught exception None
When running pytest (by default it captures stdout/stderr; see pytest doc) there is an exception:
This happens just because of this line in the test code:
Apparently, pywikibot sets logging at import at this is not a best practice: https://github.com/pytest-dev/pytest/issues/5502#issuecomment-548013400
Refactoring of pywikibot logging setting is required. I think also terminal user-interface must be refactorized.