Browse Source

pyln-testing: Do not require a conftest.py to annotate tests

In the c-lightning tests we have `tests/conftest.py` which annotates test
function with the outcome. If we use pyln-testing outside of the c-lightning
tree we cannot rely on that annotation being there, so we assume it passed.
travis-debug
Christian Decker 5 years ago
parent
commit
9e59740268
  1. 3
      contrib/pyln-testing/pyln/testing/fixtures.py

3
contrib/pyln-testing/pyln/testing/fixtures.py

@ -47,7 +47,8 @@ def directory(request, test_base_dir, test_name):
# determine whether we succeeded or failed. Outcome can be None if the
# failure occurs during the setup phase, hence the use to getattr instead
# of accessing it directly.
outcome = getattr(request.node, 'rep_call', None).outcome
rep_call = getattr(request.node, 'rep_call', None)
outcome = 'passed' if rep_call is None else rep_call.outcome
failed = not outcome or request.node.has_errors or outcome != 'passed'
if not failed:

Loading…
Cancel
Save