-
Notifications
You must be signed in to change notification settings - Fork 912
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyln: Allow users to override the LightningNode class
Quite a few of the things in the LightningNode class are tailored to their use in the c-lightning tests, so I decided to split those customizations out into a sub-class, and adding one more fixture that just serves the class. This allows us to override the LightningNode implementation in our own tests, while still having sane defaults for other users.
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
from utils import DEVELOPER, TEST_NETWORK # noqa: F401,F403 | ||
from pyln.testing.fixtures import directory, test_base_dir, test_name, chainparams, node_factory, bitcoind, teardown_checks, db_provider, executor # noqa: F401,F403 | ||
from pyln.testing import utils | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def node_cls(): | ||
return LightningNode | ||
|
||
|
||
class LightningNode(utils.LightningNode): | ||
def __init__(self, *args, **kwargs): | ||
utils.LightningNode.__init__(self, *args, **kwargs) | ||
|
||
# Yes, we really want to test the local development version, not | ||
# something in out path. | ||
self.daemon.executable = 'lightningd/lightningd' |