mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
tests: not DEVELOPER -> mark.developer
Nicer syntaxtic sugar for marking pytests as 'developer required'
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from pyln.testing.utils import DEVELOPER
|
||||
|
||||
|
||||
# This function is based upon the example of how to
|
||||
# "[make] test result information available in fixtures" at:
|
||||
@@ -21,3 +23,14 @@ def pytest_runtest_makereport(item, call):
|
||||
def pytest_configure(config):
|
||||
config.addinivalue_line("markers",
|
||||
"slow_test: slow tests aren't run under Valgrind")
|
||||
config.addinivalue_line("markers",
|
||||
"developer: only run when developer is flagged on")
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
for mark in item.iter_markers(name='developer'):
|
||||
if not DEVELOPER:
|
||||
if len(mark.args):
|
||||
pytest.skip('!DEVELOPER: {}'.format(mark.args[0]))
|
||||
else:
|
||||
pytest.skip('!DEVELOPER: Requires DEVELOPER=1')
|
||||
|
||||
Reference in New Issue
Block a user