Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sauron: Refactor tests to reduce code repetition #622

Open
ca-ruz opened this issue Dec 5, 2024 · 1 comment
Open

sauron: Refactor tests to reduce code repetition #622

ca-ruz opened this issue Dec 5, 2024 · 1 comment

Comments

@ca-ruz
Copy link
Contributor

ca-ruz commented Dec 5, 2024

Currently, there are four separate test files for Sauron, each corresponding to one of the four different backends. These test files contain repetitive setup code and assertions, with almost identical logic across all files. This duplication makes the tests harder to maintain, less efficient, and prone to inconsistencies when updates are needed.

We should:
-Consolidate the similar tests into a single parameterized test file.
-Use parameterization to test all four backends within the same structure, reducing redundancy and improving maintainability.

Related to #584.

@chrisguida
Copy link
Collaborator

chrisguida commented Feb 7, 2025

This is needed more than ever to fix the way we use the TEST_NETWORK global variable. See this PR: #649 (comment)

What we really need is a single abstract override fixture (probably in conftest.py) to do all our generic settings (like removing the bcli-related options), then a concrete class that overrides that, one for each network (ie bitcoin, testnet, signet, and mutinynet). That way we can avoid using the TEST_NETWORK global variable entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants