Page MenuHomePhabricator

[electrum] don't run the unit tests twice
ClosedPublic

Authored by PiRK on Jul 12 2023, 16:02.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC2bf685cc6b8b: [electrum] don't run the unit tests twice
Summary

It seems like unittest.defaultTestLoader.discover imports some of the python files (scripts outside packages, __init__.py files...), so all the code that is not in a function or inside a if __name__ == "__main__" context will be executed. This explains why failure to import PyQt5 was reported as a failed test before D14135, and why the tests seemed to be run twice.

Depends on D14260

Test Plan

python test_runner.py
Check that the test results are printed only once

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable