mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
72dc97c0c1
We've been getting a bunch of 'warnings' about an unknown mark. This silences the warning, by registering the mark as expected. =========================================================== warnings summary =========================================================== tests/test_closing.py:152 /home/niftynei/dev/lightning/tests/test_closing.py:152: PytestUnknownMarkWarning: Unknown pytest.mark.slow_test - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html @pytest.mark.slow_test tests/test_closing.py:214 /home/niftynei/dev/lightning/tests/test_closing.py:214: PytestUnknownMarkWarning: Unknown pytest.mark.slow_test - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html @pytest.mark.slow_test tests/test_closing.py:704
24 lines
787 B
Python
24 lines
787 B
Python
import pytest
|
|
|
|
|
|
# This function is based upon the example of how to
|
|
# "[make] test result information available in fixtures" at:
|
|
# https://pytest.org/latest/example/simple.html#making-test-result-information-available-in-fixtures
|
|
# and:
|
|
# https://github.com/pytest-dev/pytest/issues/288
|
|
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
|
|
def pytest_runtest_makereport(item, call):
|
|
# execute all other hooks to obtain the report object
|
|
outcome = yield
|
|
rep = outcome.get_result()
|
|
|
|
# set a report attribute for each phase of a call, which can
|
|
# be "setup", "call", "teardown"
|
|
|
|
setattr(item, "rep_" + rep.when, rep)
|
|
|
|
|
|
def pytest_configure(config):
|
|
config.addinivalue_line("markers",
|
|
"slow_test: slow tests aren't run under Valgrind")
|