add runtime env to report

This commit is contained in:
debugtalk
2018-02-27 10:47:34 +08:00
parent b3d4eecdfd
commit 10efc8f772
3 changed files with 18 additions and 2 deletions

View File

@@ -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'

View File

@@ -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"] \

View File

@@ -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>