Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions django_jenkins/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from xml.etree import ElementTree as ET

from django.test.runner import DiscoverRunner
from django.utils.encoding import smart_text
try:
from django.utils.encoding import smart_str
except:
from django.utils.encoding import smart_text as smart_str


class EXMLTestResult(TextTestResult):
Expand Down Expand Up @@ -64,12 +67,12 @@ def stopTest(self, test):
output = sys.stdout.getvalue() if hasattr(sys.stdout, 'getvalue') else ''
if output:
sysout = ET.SubElement(self.testcase, 'system-out')
sysout.text = smart_text(output, errors='ignore')
sysout.text = smart_str(output, errors='ignore')

error = sys.stderr.getvalue() if hasattr(sys.stderr, 'getvalue') else ''
if error:
syserr = ET.SubElement(self.testcase, 'system-err')
syserr.text = smart_text(error, errors='ignore')
syserr.text = smart_str(error, errors='ignore')

super(EXMLTestResult, self).stopTest(test)

Expand Down Expand Up @@ -103,8 +106,8 @@ def _add_tb_to_test(self, test, test_result, err):
exc_class, exc_value, tb = err
tb_str = self._exc_info_to_string(err, test)
test_result.set('type', '%s.%s' % (exc_class.__module__, exc_class.__name__))
test_result.set('message', smart_text(exc_value))
test_result.text = smart_text(tb_str)
test_result.set('message', smart_str(exc_value))
test_result.text = smart_str(tb_str)

def dump_xml(self, output_dir):
"""
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='django-jenkins',
version='1.11.0',
version='1.12.0',
author='Mikhail Podgurskiy',
author_email='kmmbvnr@gmail.com',
description='Plug and play continuous integration with django and jenkins',
Expand All @@ -36,6 +36,10 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Testing'
],
Expand Down