Jan-19-2018, 01:52 PM
One should NOT change __doc__ for this purpose, it is the docstring of the function
__dict__ contains function attributes, i.e. the information you want to pass, should be supplied as argument
you can use mark decorator to mark your tests
something like
__dict__ contains function attributes, i.e. the information you want to pass, should be supplied as argument
you can use mark decorator to mark your tests
something like
import pytest @pytest.mark.servername(server='my_server_name') def test_function(): # do your testthen in conftest.py (only makereport hook)
@pytest.mark.hookwrapper def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() report.server_name = item.keywords['servername'].kwargs['server']