mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
tests: add marker for v1/v2 channel opens
Tests that will only run when !EXPERIMENTAL_DUAL_FUND:
@pytest.marker.openchannel('v1')
def test_...()
Tests that will only run when EXPERIMENTAL_DUAL_FUND:
@pytest.marker.openchannel('v2')
def test_...()
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from pyln.testing.utils import DEVELOPER
|
||||
from pyln.testing.utils import DEVELOPER, EXPERIMENTAL_DUAL_FUND
|
||||
|
||||
|
||||
# This function is based upon the example of how to
|
||||
@@ -25,9 +25,21 @@ def pytest_configure(config):
|
||||
"slow_test: slow tests aren't run under Valgrind")
|
||||
config.addinivalue_line("markers",
|
||||
"developer: only run when developer is flagged on")
|
||||
config.addinivalue_line("markers",
|
||||
"openchannel: Limit this test to only run 'v1' or 'v2' openchannel protocol")
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
open_versions = [mark.args[0] for mark in item.iter_markers(name='openchannel')]
|
||||
if open_versions:
|
||||
if 'v1' not in open_versions and not EXPERIMENTAL_DUAL_FUND:
|
||||
pytest.skip('v2-only test, EXPERIMENTAL_DUAL_FUND=0')
|
||||
if 'v2' not in open_versions and EXPERIMENTAL_DUAL_FUND:
|
||||
pytest.skip('v1-only test, EXPERIMENTAL_DUAL_FUND=1')
|
||||
else: # If there's no openchannel marker, skip if EXP_DF
|
||||
if EXPERIMENTAL_DUAL_FUND:
|
||||
pytest.skip('v1-only test, EXPERIMENTAL_DUAL_FUND=1')
|
||||
|
||||
for mark in item.iter_markers(name='developer'):
|
||||
if not DEVELOPER:
|
||||
if len(mark.args):
|
||||
|
||||
Reference in New Issue
Block a user