Page MenuHomePhabricator

[electrum] exclude the regtest directory from the unit test discovery
ClosedPublic

Authored by PiRK on Jun 26 2025, 12:00.

Details

Summary

In a future diff I want to replace the pytest framework with the regular the unittest module for functional tests (electrumabc/tests/regtest/), but we don't want these functional tests to be found and executed by the unit test runner. They will need to run with their own framework, with a node compiled...etc

Add a simple filter class to skips all tests that contain "regtest" in their fully qualified module name (e.g electrumabc.tests.regtest.test_rpc_misc)

Test Plan

Rebase on D18293 and try:
cd electrum && python test_runner.py

See that it doesn't fail because of the functional tests not finding bitcoind.

Diff Detail

Event Timeline

PiRK requested review of this revision.Jun 26 2025, 12:00
PiRK updated this revision to Diff 54593.

remove irrelevant commments from a previous iteration

electrum/test_runner.py
32

A TestSuite can contain other TestSuite recurvisely. The leaves of the tree will not be a TestSuite, but rather a unittest.TestCase

electrum/test_runner.py
12–14

This is still needed, as the error happens during discovery, before we can filter out the test case based on its module name.

This revision is now accepted and ready to land.Jun 27 2025, 11:59