HomePhabricator

[electrum] don't run the unit tests twice

Description

[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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14261

Details

Provenance
PiRKAuthored on Jul 12 2023, 15:10
PiRKPushed on Jul 12 2023, 20:47
Reviewer
Restricted Project
Differential Revision
D14261: [electrum] don't run the unit tests twice
Parents
rABCcfbb96bfc913: [electrum] add a basic test for setup.py
Branches
Unknown
Tags
Unknown