mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 19:39:44 +08:00
add runtime env to report
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
__title__ = 'HttpRunner'
|
||||
__description__ = 'HTTP test runner, not just about api test and load test.'
|
||||
__url__ = 'https://github.com/HttpRunner/HttpRunner'
|
||||
__version__ = '0.9.6a1'
|
||||
__version__ = '0.9.6a2'
|
||||
__author__ = 'debugtalk'
|
||||
__author_email__ = 'mail@debugtalk.com'
|
||||
__license__ = 'MIT'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import io
|
||||
import os
|
||||
import platform
|
||||
import time
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
@@ -9,6 +10,15 @@ from jinja2 import Template
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
|
||||
def get_platform():
|
||||
return {
|
||||
"python_version": "{}_{}".format(
|
||||
platform.python_implementation(),
|
||||
platform.python_version()
|
||||
),
|
||||
"platform": platform.platform()
|
||||
}
|
||||
|
||||
def get_summary(result):
|
||||
""" get summary from test result
|
||||
"""
|
||||
@@ -21,7 +31,8 @@ def get_summary(result):
|
||||
'skipped': len(result.skipped),
|
||||
'expectedFailures': len(result.expectedFailures),
|
||||
'unexpectedSuccesses': len(result.unexpectedSuccesses)
|
||||
}
|
||||
},
|
||||
"platform": get_platform()
|
||||
}
|
||||
summary["stat"]["successes"] = summary["stat"]["testsRun"] \
|
||||
- summary["stat"]["failures"] \
|
||||
|
||||
@@ -142,6 +142,11 @@
|
||||
<th>DURATION</th>
|
||||
<td colspan="4">{{ '%0.3f'| format(time.duration|float) }} seconds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>PLATFORM</th>
|
||||
<td colspan="2">{{ platform.python_version }} </td>
|
||||
<td colspan="2">{{ platform.platform }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TOTAL</th>
|
||||
<th>SUCCESS</th>
|
||||
|
||||
Reference in New Issue
Block a user