diff --git a/.travis.yml b/.travis.yml index e7c094a..8d42e75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,10 @@ matrix: dist: xenial sudo: true env: TOXENV=py37 + - python: 3.8 + dist: xenial + sudo: true + env: TOXENV=py38 env: - TOXENV=py27 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 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/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", 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]