diff --git a/HTMLTestRunner_Chart.py b/HTMLTestRunner_Chart.py index 3eec9e3..d663185 100644 --- a/HTMLTestRunner_Chart.py +++ b/HTMLTestRunner_Chart.py @@ -206,7 +206,7 @@ class Template_mixin(object): %(title)s - + @@ -939,7 +939,10 @@ def stopTest(self, test): sys.stderr.write("Retesting... ") sys.stderr.write(str(test)) sys.stderr.write('..%d \n' % self.trys) - doc = test._testMethodDoc or '' + try: + doc = test._testMethodDoc or '' + except Exception: + doc = '' if doc.find('_retry')!=-1: doc = doc[:doc.find('_retry')] desc ="%s_retry:%d" %(doc, self.trys) @@ -1121,10 +1124,10 @@ def Write(self, title, heading, desc, data): if status[j] == "错误": description["error"] = str(status[j + 1]) else: - description["title"] = title.encode("gbk") - description["status"] = heading[2][1].encode("gbk") - description["desc"] = desc.encode("gbk") - description["data"] = data.encode("gbk") + description["title"] = title.encode("utf-8") + description["status"] = heading[2][1].encode("utf-8") + description["desc"] = desc.encode("utf-8") + description["data"] = data.encode("utf-8") status = heading[2][1].split(" ") for j in range(0, len(status)): if status[j] == u"通过": diff --git a/license b/license new file mode 100644 index 0000000..feacdb9 --- /dev/null +++ b/license @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 githublitao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.