Skip to content

Commit 63db26d

Browse files
rst0gitsysradium
authored andcommitted
Run tests with Python 3.8
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
1 parent 63e95fd commit 63db26d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ matrix:
1414
dist: xenial
1515
sudo: true
1616
env: TOXENV=py37
17+
- python: 3.8-dev
18+
dist: xenial
19+
sudo: true
20+
env: TOXENV=py38
1721

1822
env:
1923
- TOXENV=py27

junit_xml/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ def build_xml_doc(self, encoding=None):
124124

125125
# build the test suite element
126126
test_suite_attributes = dict()
127-
test_suite_attributes["name"] = decode(self.name, encoding)
128127
if any(c.assertions for c in self.test_cases):
129128
test_suite_attributes["assertions"] = str(sum([int(c.assertions) for c in self.test_cases if c.assertions]))
130129
test_suite_attributes["disabled"] = str(len([c for c in self.test_cases if not c.is_enabled]))
131-
test_suite_attributes["failures"] = str(len([c for c in self.test_cases if c.is_failure()]))
132130
test_suite_attributes["errors"] = str(len([c for c in self.test_cases if c.is_error()]))
131+
test_suite_attributes["failures"] = str(len([c for c in self.test_cases if c.is_failure()]))
132+
test_suite_attributes["name"] = decode(self.name, encoding)
133133
test_suite_attributes["skipped"] = str(len([c for c in self.test_cases if c.is_skipped()]))
134-
test_suite_attributes["time"] = str(sum(c.elapsed_sec for c in self.test_cases if c.elapsed_sec))
135134
test_suite_attributes["tests"] = str(len(self.test_cases))
135+
test_suite_attributes["time"] = str(sum(c.elapsed_sec for c in self.test_cases if c.elapsed_sec))
136136

137137
if self.hostname:
138138
test_suite_attributes["hostname"] = decode(self.hostname, encoding)
@@ -288,7 +288,7 @@ def to_xml_report_string(test_suites, prettyprint=True, encoding=None):
288288
attributes = defaultdict(int)
289289
for ts in test_suites:
290290
ts_xml = ts.build_xml_doc(encoding=encoding)
291-
for key in ["failures", "errors", "tests", "disabled"]:
291+
for key in ["disabled", "errors", "failures", "tests"]:
292292
attributes[key] += int(ts_xml.get(key, 0))
293293
for key in ["time"]:
294294
attributes[key] += float(ts_xml.get(key, 0))

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27, pypy, py35, py36, py37, cover, flake8
2+
envlist = py27, pypy, py35, py36, py37, py38, cover, flake8
33
sitepackages = False
44

55
[testenv]

0 commit comments

Comments
 (0)