| Server IP : 123.56.80.60 / Your IP : 216.73.216.78 Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586 User : SYSTEM ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files/python/Lib/site-packages/tox/logs/ |
Upload File : |
"""Generate json report of a run"""
from __future__ import absolute_import, unicode_literals
import json
import os
import socket
import sys
from tox.version import __version__
from .command import CommandLog
from .env import EnvLog
class ResultLog(object):
"""The result of a tox session"""
def __init__(self):
command_log = []
self.command_log = CommandLog(None, command_log)
self.dict = {
"reportversion": "1",
"toxversion": __version__,
"platform": sys.platform,
"host": os.getenv(str("HOSTNAME")) or socket.getfqdn(),
"commands": command_log,
}
@classmethod
def from_json(cls, data):
result = cls()
result.dict = json.loads(data)
result.command_log = CommandLog(None, result.dict["commands"])
return result
def get_envlog(self, name):
"""Return the env log of a environment (create on first call)"""
test_envs = self.dict.setdefault("testenvs", {})
env_data = test_envs.setdefault(name, {})
return EnvLog(self, name, env_data)
def dumps_json(self):
"""Return the json dump of the current state, indented"""
return json.dumps(self.dict, indent=2)