From 63db26da353790500642fd02cae1543eb41aab8b Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Wed, 11 Sep 2019 12:45:12 +0100 Subject: [PATCH 1/4] Run tests with Python 3.8 Signed-off-by: Radostin Stoyanov --- .travis.yml | 4 ++++ junit_xml/__init__.py | 8 ++++---- tox.ini | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index e7c094a..f15766e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,10 @@ matrix: dist: xenial sudo: true env: TOXENV=py37 + - python: 3.8-dev + dist: xenial + sudo: true + env: TOXENV=py38 env: - TOXENV=py27 diff --git a/junit_xml/__init__.py b/junit_xml/__init__.py index 78a153e..0cfef29 100644 --- a/junit_xml/__init__.py +++ b/junit_xml/__init__.py @@ -124,15 +124,15 @@ def build_xml_doc(self, encoding=None): # build the test suite element test_suite_attributes = dict() - test_suite_attributes["name"] = decode(self.name, encoding) if any(c.assertions for c in self.test_cases): test_suite_attributes["assertions"] = str(sum([int(c.assertions) for c in self.test_cases if c.assertions])) test_suite_attributes["disabled"] = str(len([c for c in self.test_cases if not c.is_enabled])) - test_suite_attributes["failures"] = str(len([c for c in self.test_cases if c.is_failure()])) test_suite_attributes["errors"] = str(len([c for c in self.test_cases if c.is_error()])) + test_suite_attributes["failures"] = str(len([c for c in self.test_cases if c.is_failure()])) + test_suite_attributes["name"] = decode(self.name, encoding) test_suite_attributes["skipped"] = str(len([c for c in self.test_cases if c.is_skipped()])) - test_suite_attributes["time"] = str(sum(c.elapsed_sec for c in self.test_cases if c.elapsed_sec)) test_suite_attributes["tests"] = str(len(self.test_cases)) + test_suite_attributes["time"] = str(sum(c.elapsed_sec for c in self.test_cases if c.elapsed_sec)) if self.hostname: test_suite_attributes["hostname"] = decode(self.hostname, encoding) @@ -288,7 +288,7 @@ def to_xml_report_string(test_suites, prettyprint=True, encoding=None): attributes = defaultdict(int) for ts in test_suites: ts_xml = ts.build_xml_doc(encoding=encoding) - for key in ["failures", "errors", "tests", "disabled"]: + for key in ["disabled", "errors", "failures", "tests"]: attributes[key] += int(ts_xml.get(key, 0)) for key in ["time"]: attributes[key] += float(ts_xml.get(key, 0)) diff --git a/tox.ini b/tox.ini index ab95ab1..3fdb993 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, pypy, py35, py36, py37, cover, flake8 +envlist = py27, pypy, py35, py36, py37, py38, cover, flake8 sitepackages = False [testenv] From 19d3cc333d35dfd2d17d75c506336c15e5c6685a Mon Sep 17 00:00:00 2001 From: Brian Beyer Date: Sat, 22 Feb 2020 13:17:57 -0700 Subject: [PATCH 2/4] bump to version 1.9 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5d8a46e..8aba068 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def read(fname): packages=find_packages(exclude=["tests"]), description="Creates JUnit XML test result documents that can be read by tools such as Jenkins", long_description=read("README.rst"), - version="1.8.1", + version="1.9", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", From 856414648cbab3f64e69b856bc25cea8b9aa0377 Mon Sep 17 00:00:00 2001 From: Brian Beyer Date: Sat, 22 Feb 2020 13:25:34 -0700 Subject: [PATCH 3/4] change to 3.8 branch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f15766e..8d42e75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ matrix: dist: xenial sudo: true env: TOXENV=py37 - - python: 3.8-dev + - python: 3.8 dist: xenial sudo: true env: TOXENV=py38 From 4bd08a272f059998cedf9b7779f944d49eba13a6 Mon Sep 17 00:00:00 2001 From: Brian Beyer Date: Sat, 22 Feb 2020 13:43:21 -0700 Subject: [PATCH 4/4] update readme --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 470cef1..b585af1 100644 --- a/README.rst +++ b/README.rst @@ -89,3 +89,10 @@ Running the tests pip install tox tox +Releasing a new version +----------------------- + +1. Bump version in `setup.py` +2. Build distribution with `python setup.py sdist bdist_wheel` +3. Upload to Pypi with `twine upload dist/*` +4. Verify the new version was uploaded at https://pypi.org/project/junit-xml/#history