я нашел, сделав ниже путь.
def pytest_configure(self, config):
# below lines has been added to manipulate the log path in html report while running in jenkins
if 'BUILD_URL' in config._metadata:
self.build_url = os.path.join(config._metadata['BUILD_URL'],'artifact')
@pytest.mark.optionalhook
def pytest_html_results_table_html(self, report, data):
if test_artifact_simulate and os.path.isfile(test_artifact_command):
from py.xml import html
ul = html.ul()
if self.build_url != None :
simulate_log = test_artifact_simulate[test_artifact_simulate.find('dut'):]
print 'KKT simulate log is %s' %simulate_log
jenkins_log_path = os.path.join(self.build_url,simulate_log)
print 'KKT jenkins_log_path log is %s' %jenkins_log_path
li = html.li(html.a(os.path.basename(test_artifact_simulate),
href= jenkins_log_path, type="text/plain"))
else :
li = html.li(html.a(os.path.basename(test_artifact_simulate),
href='file://' + test_artifact_simulate, type="text/plain"))
ul.append(li)
div = html.div()
div.append(html.p("Test artifacts:"))
div.append(ul)
data.append(div)