Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package subunit for openSUSE:Factory checked in at 2022-05-10 15:09:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/subunit (Old) and /work/SRC/openSUSE:Factory/.subunit.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "subunit" Tue May 10 15:09:56 2022 rev:10 rq:975704 version:1.4.0+git.1643134405.a629de4 Changes: -------- --- /work/SRC/openSUSE:Factory/subunit/subunit.changes 2021-10-20 20:24:20.533380221 +0200 +++ /work/SRC/openSUSE:Factory/.subunit.new.1538/subunit.changes 2022-05-10 15:10:06.851432672 +0200 @@ -1,0 +2,11 @@ +Mon May 09 06:19:54 UTC 2022 - mc...@cepl.eu + +- Update to version 1.4.0+git.1643134405.a629de4: + * Explicitly invoke python3. + * Check minimum version of Python in configure.ac. + * Add testing for Python 3.10 + * Stop using io imports from testtools + * Remove logic for Python < 3.6 + * Drop support for Python 2.7, 3.5 + +------------------------------------------------------------------- Old: ---- subunit-1.4.0+git.1627548288.c87ffbd.tar.xz New: ---- subunit-1.4.0+git.1643134405.a629de4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ subunit.spec ++++++ --- /var/tmp/diff_new_pack.R4OqPV/_old 2022-05-10 15:10:10.851437714 +0200 +++ /var/tmp/diff_new_pack.R4OqPV/_new 2022-05-10 15:10:10.855437719 +0200 @@ -1,7 +1,7 @@ # # spec file for package subunit # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %global majver 1.4 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: subunit -Version: 1.4.0+git.1627548288.c87ffbd +Version: 1.4.0+git.1643134405.a629de4 Release: 0 Summary: C library for the subunit testing protocol License: Apache-2.0 OR BSD-3-Clause ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.R4OqPV/_old 2022-05-10 15:10:10.903437779 +0200 +++ /var/tmp/diff_new_pack.R4OqPV/_new 2022-05-10 15:10:10.907437785 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/testing-cabal/subunit.git</param> - <param name="changesrevision">faaca9b50f59d63a21663a1dc8ed21f22ffb6223</param></service></servicedata> + <param name="changesrevision">a629de4fbf04b62361e67a1e04e29474ca18d2b0</param></service></servicedata> (No newline at EOF) ++++++ subunit-1.4.0+git.1627548288.c87ffbd.tar.xz -> subunit-1.4.0+git.1643134405.a629de4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/NEWS new/subunit-1.4.0+git.1643134405.a629de4/NEWS --- old/subunit-1.4.0+git.1627548288.c87ffbd/NEWS 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/NEWS 2022-01-25 19:13:25.000000000 +0100 @@ -5,6 +5,18 @@ NEXT (In development) --------------------- +IMPROVEMENTS +~~~~~~~~~~~~ + +* Add support for Python 3.9 + (Thomas Grainger) + +* Add support for Python 3.10 + (Stephen Finucane) + +* Drop support for Python 2.7, 3.4, and 3.5 + (Stephen Finucane) + BUGFIXES ~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/configure.ac new/subunit-1.4.0+git.1643134405.a629de4/configure.ac --- old/subunit-1.4.0+git.1627548288.c87ffbd/configure.ac 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/configure.ac 2022-01-25 19:13:25.000000000 +0100 @@ -24,7 +24,7 @@ AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_LIBTOOL -AM_PATH_PYTHON +AM_PATH_PYTHON([3.6]) AS_IF([test "$GCC" = "yes"], [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-1to2 new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-1to2 --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-1to2 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-1to2 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2013 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-2to1 new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-2to1 --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-2to1 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-2to1 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2013 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-filter new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-filter --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-filter 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-filter 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 200-2013 Robert Collins <robe...@robertcollins.net> # (C) 2009 Martin Pool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-ls new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-ls --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-ls 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-ls 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2008 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-notify new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-notify --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-notify 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-notify 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2010 Jelmer Vernooij <jel...@samba.org> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-output new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-output --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-output 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-output 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2013 Subunit Contributors # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-stats new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-stats --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-stats 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-stats 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-tags new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-tags --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit-tags 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit-tags 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2csv new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2csv --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2csv 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2csv 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2disk new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2disk --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2disk 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2disk 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2013 Subunit Contributors # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2gtk new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2gtk --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2gtk 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2gtk 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # @@ -174,26 +174,15 @@ GObject.idle_add(self.update_counts) def addSkip(self, test, reason): - # addSkip is new in Python 2.7/3.1 - addSkip = getattr(super(GTKTestResult, self), 'addSkip', None) - if callable(addSkip): - addSkip(test, reason) + super(GTKTestResult, self).addSkip(test, reason) GObject.idle_add(self.update_counts) def addExpectedFailure(self, test, err): - # addExpectedFailure is new in Python 2.7/3.1 - addExpectedFailure = getattr(super(GTKTestResult, self), - 'addExpectedFailure', None) - if callable(addExpectedFailure): - addExpectedFailure(test, err) + super(GTKTestResult, self).addExpectedFailure(test, err) GObject.idle_add(self.update_counts) def addUnexpectedSuccess(self, test): - # addUnexpectedSuccess is new in Python 2.7/3.1 - addUnexpectedSuccess = getattr(super(GTKTestResult, self), - 'addUnexpectedSuccess', None) - if callable(addUnexpectedSuccess): - addUnexpectedSuccess(test) + super(GTKTestResult, self).addUnexpectedSuccess(test) GObject.idle_add(self.update_counts) def progress(self, offset, whence): @@ -218,16 +207,21 @@ self.ok_label.set_text(str(self.testsRun - bad)) self.not_ok_label.set_text(str(bad)) + GObject.threads_init() result = StreamToExtendedDecorator(GTKTestResult()) test = ByteStreamToStreamResult(sys.stdin, non_subunit_name='stdout') # Get setup while Gtk.events_pending(): - Gtk.main_iteration() + Gtk.main_iteration() + + # Start IO def run_and_finish(): test.run(result) result.stopTestRun() + + t = threading.Thread(target=run_and_finish) t.daemon = True result.startTestRun() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2junitxml new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2junitxml --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2junitxml 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2junitxml 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2pyunit new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2pyunit --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/subunit2pyunit 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/subunit2pyunit 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/filters/tap2subunit new/subunit-1.4.0+git.1643134405.a629de4/filters/tap2subunit --- old/subunit-1.4.0+git.1627548288.c87ffbd/filters/tap2subunit 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/filters/tap2subunit 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2009 Robert Collins <robe...@robertcollins.net> # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/pyproject.toml new/subunit-1.4.0+git.1643134405.a629de4/pyproject.toml --- old/subunit-1.4.0+git.1627548288.c87ffbd/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/subunit-1.4.0+git.1643134405.a629de4/pyproject.toml 2022-01-25 19:13:25.000000000 +0100 @@ -0,0 +1,5 @@ +[build-system] +# These are the assumed default build requirements from pip: +# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +requires = ["setuptools>=43.0.0", "wheel"] +build-backend = "setuptools.build_meta" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/__init__.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/__init__.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/__init__.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/__init__.py 2022-01-25 19:13:25.000000000 +0100 @@ -42,8 +42,7 @@ Subunit includes extensions to the Python ``TestResult`` protocol. These are all done in a compatible manner: ``TestResult`` objects that do not implement the extension methods will not cause errors to be raised, instead the extension -will either lose fidelity (for instance, folding expected failures to success -in Python versions < 2.7 or 3.1), or discard the extended data (for extra +will either lose fidelity, or discard the extended data (for extra details, tags, timestamping and progress markers). The test outcome methods ``addSuccess``, ``addError``, ``addExpectedFailure``, @@ -116,25 +115,20 @@ * subunit.test_results contains TestResult helper classes. """ +from io import BytesIO +from io import StringIO +from io import UnsupportedOperation as _UnsupportedOperation import os import re import subprocess import sys import unittest -try: - from io import UnsupportedOperation as _UnsupportedOperation -except ImportError: - _UnsupportedOperation = AttributeError from extras import safe_hasattr from testtools import content, content_type, ExtendedToOriginalDecorator from testtools.content import TracebackContent from testtools.compat import _b, _u try: - from testtools.compat import BytesIO, StringIO -except ImportError: - from io import BytesIO, StringIO -try: from testtools.testresult.real import _StringException RemoteException = _StringException except ImportError: @@ -513,9 +507,7 @@ """ self.client = ExtendedToOriginalDecorator(client) if stream is None: - stream = sys.stdout - if sys.version_info > (3, 0): - stream = stream.buffer + stream = sys.stdout.buffer self._stream = stream self._forward_stream = forward_stream or DiscardStream() # state objects we can switch too @@ -1292,11 +1284,7 @@ def _unwrap_text(stream): """Unwrap stream if it is a text stream to get the original buffer.""" exceptions = (_UnsupportedOperation, IOError) - if sys.version_info > (3, 0): - unicode_type = str - else: - unicode_type = unicode - exceptions += (ValueError,) + unicode_type = str try: # Read streams if type(stream.read(0)) is unicode_type: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/details.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/details.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/details.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/details.py 2022-01-25 19:13:25.000000000 +0100 @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -16,12 +16,10 @@ """Handlers for outcome details.""" +from io import BytesIO, StringIO + from testtools import content, content_type from testtools.compat import _b -try: - from testtools.compat import BytesIO, StringIO -except ImportError: - from io import BytesIO, StringIO from subunit import chunked diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/iso8601.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/iso8601.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/iso8601.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/iso8601.py 2022-01-25 19:13:25.000000000 +0100 @@ -1,5 +1,5 @@ # Copyright (c) 2007 Michael Twomey -# +# # 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 @@ -7,10 +7,10 @@ # 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. @@ -31,7 +31,6 @@ from datetime import datetime, timedelta, tzinfo import re -import sys __all__ = ["parse_date", "ParseError"] @@ -47,10 +46,6 @@ zulu = "Z".encode('latin-1') minus = "-".encode('latin-1') -if sys.version_info < (3, 0): - bytes = str - - class ParseError(Exception): """Raised when there is a problem parsing a date string""" @@ -58,7 +53,7 @@ ZERO = timedelta(0) class Utc(tzinfo): """UTC - + """ def utcoffset(self, dt): return ZERO @@ -72,7 +67,7 @@ class FixedOffset(tzinfo): """Fixed offset in hours and minutes from UTC - + """ def __init__(self, offset_hours, offset_minutes, name): self.__offset = timedelta(hours=offset_hours, minutes=offset_minutes) @@ -86,13 +81,13 @@ def dst(self, dt): return ZERO - + def __repr__(self): return "<FixedOffset %r>" % self.__name def parse_timezone(tzstring, default_timezone=UTC): """Parses ISO 8601 time zone specs into tzinfo offsets - + """ if tzstring == zulu: return default_timezone @@ -111,7 +106,7 @@ def parse_date(datestring, default_timezone=UTC): """Parses ISO 8601 dates into datetime objects - + The timezone is parsed from the date string. However it is quite common to have dates without a timezone (not strictly correct). In this case the default timezone specified in default_timezone is used. This is UTC by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/run.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/run.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/run.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/run.py 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Simple subunit testrunner for python # Copyright (C) Jelmer Vernooij <jel...@samba.org> 2007 @@ -136,10 +136,7 @@ if hasattr(stdout, 'fileno'): # Patch stdout to be unbuffered, so that pdb works well on 2.6/2.7. binstdout = io.open(stdout.fileno(), 'wb', 0) - if sys.version_info[0] > 2: - sys.stdout = io.TextIOWrapper(binstdout, encoding=sys.stdout.encoding) - else: - sys.stdout = binstdout + sys.stdout = io.TextIOWrapper(binstdout, encoding=sys.stdout.encoding) stdout = sys.stdout SubunitTestProgram(module=None, argv=argv, testRunner=runner, stdout=stdout, exit=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/sample-script.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/sample-script.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/sample-script.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/sample-script.py 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys if sys.platform == "win32": import msvcrt, os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/sample-two-script.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/sample-two-script.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/sample-two-script.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/sample-two-script.py 2022-01-25 19:13:25.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys print("test old mcdonald") print("success old mcdonald") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_chunked.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_chunked.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_chunked.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_chunked.py 2022-01-25 19:13:25.000000000 +0100 @@ -7,7 +7,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -15,13 +15,10 @@ # limitations under that license. # +from io import BytesIO import unittest from testtools.compat import _b -try: - from testtools.compat import BytesIO -except ImportError: - from io import BytesIO import subunit.chunked diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_details.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_details.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_details.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_details.py 2022-01-25 19:13:25.000000000 +0100 @@ -17,10 +17,6 @@ import unittest from testtools.compat import _b -try: - from testtools.compat import StringIO -except ImportError: - from io import StringIO import subunit.tests from subunit import content, content_type, details diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_subunit_filter.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_subunit_filter.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_subunit_filter.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_subunit_filter.py 2022-01-25 19:13:25.000000000 +0100 @@ -17,21 +17,18 @@ """Tests for subunit.TestResultFilter.""" from datetime import datetime +from io import BytesIO import os import subprocess import sys -from subunit import iso8601 import unittest -from testtools import TestCase from testtools.compat import _b -try: - from testtools.compat import BytesIO -except ImportError: - from io import BytesIO +from testtools import TestCase from testtools.testresult.doubles import ExtendedTestResult, StreamResult import subunit +from subunit import iso8601 from subunit.test_results import make_tag_filter, TestResultFilter from subunit import ByteStreamToStreamResult, StreamResultToBytes @@ -300,10 +297,6 @@ ('stopTest', 'foo - renamed')], [(ev[0], ev[1].id()) for ev in result._events]) - if sys.version_info < (2, 7): - # These tests require Python >=2.7. - del test_fixup_expected_failures, test_fixup_expected_errors, test_fixup_unexpected_success - class TestFilterCommand(TestCase): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_subunit_stats.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_subunit_stats.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_subunit_stats.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_subunit_stats.py 2022-01-25 19:13:25.000000000 +0100 @@ -6,7 +6,7 @@ # license at the users choice. A copy of both licenses are available in the # project source as Apache-2.0 and BSD. You may not use this file except in # compliance with one of these two licences. -# +# # Unless required by applicable law or agreed to in writing, software # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -16,13 +16,11 @@ """Tests for subunit.TestResultStats.""" +from io import BytesIO +from io import StringIO import unittest from testtools.compat import _b -try: - from testtools.compat import BytesIO, StringIO -except ImportError: - from io import BytesIO, StringIO import subunit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_test_protocol.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_test_protocol.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_test_protocol.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_test_protocol.py 2022-01-25 19:13:25.000000000 +0100 @@ -16,17 +16,14 @@ import datetime import io +from io import BytesIO +from io import StringIO import os import tempfile import unittest -import six from testtools import PlaceHolder, skipIf, TestCase, TestResult from testtools.compat import _b, _u -try: - from testtools.compat import BytesIO, StringIO -except ImportError: - from io import BytesIO, StringIO from testtools.content import Content, TracebackContent, text_content from testtools.content_type import ContentType try: @@ -65,21 +62,13 @@ fd, file_path = tempfile.mkstemp() self.addCleanup(os.remove, file_path) fake_file = os.fdopen(fd, 'r') - if six.PY3: - self.assertEqual(fake_file.buffer, - subunit._unwrap_text(fake_file)) - else: - self.assertEqual(fake_file, subunit._unwrap_text(fake_file)) + self.assertEqual(fake_file.buffer, subunit._unwrap_text(fake_file)) def test__unwrap_text_file_write_mode(self): fd, file_path = tempfile.mkstemp() self.addCleanup(os.remove, file_path) fake_file = os.fdopen(fd, 'w') - if six.PY3: - self.assertEqual(fake_file.buffer, - subunit._unwrap_text(fake_file)) - else: - self.assertEqual(fake_file, subunit._unwrap_text(fake_file)) + self.assertEqual(fake_file.buffer, subunit._unwrap_text(fake_file)) def test__unwrap_text_fileIO_read_mode(self): fd, file_path = tempfile.mkstemp() @@ -157,20 +146,14 @@ protocol.readFrom(pipe) bing = subunit.RemotedTestCase("bing crosby") an_error = subunit.RemotedTestCase("an error") - if six.PY3: - self.assertEqual(client.errors, - [(an_error, _remote_exception_repr + '\n')]) - self.assertEqual( - client.failures, - [(bing, _remote_exception_repr + ": " - + details_to_str({'traceback': text_content(traceback)}) + "\n")]) - else: - self.assertEqual(client.errors, - [(an_error, '_StringException\n')]) - self.assertEqual( - client.failures, - [(bing, "_StringException: " - + details_to_str({'traceback': text_content(traceback)}) + "\n")]) + self.assertEqual( + client.errors, [(an_error, _remote_exception_repr + '\n')], + ) + self.assertEqual( + client.failures, + [(bing, _remote_exception_repr + ": " + + details_to_str({'traceback': text_content(traceback)}) + "\n")], + ) self.assertEqual(client.testsRun, 3) def test_non_test_characters_forwarded_immediately(self): @@ -1024,14 +1007,9 @@ "'A test description'>", "%r" % test) result = unittest.TestResult() test.run(result) - if six.PY3: - self.assertEqual([(test, _remote_exception_repr + ': ' + - "Cannot run RemotedTestCases.\n\n")], - result.errors) - else: - self.assertEqual([(test, "_StringException: " + - "Cannot run RemotedTestCases.\n\n")], - result.errors) + self.assertEqual([(test, _remote_exception_repr + ': ' + + "Cannot run RemotedTestCases.\n\n")], + result.errors) self.assertEqual(1, result.testsRun) another_test = subunit.RemotedTestCase("A test description") self.assertEqual(test, another_test) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_test_results.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_test_results.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/tests/test_test_results.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/tests/test_test_results.py 2022-01-25 19:13:25.000000000 +0100 @@ -16,18 +16,15 @@ import csv import datetime +from io import StringIO import sys import unittest from testtools import TestCase -try: - from testtools.compat import StringIO -except ImportError: - from io import StringIO from testtools.content import ( text_content, TracebackContent, - ) +) from testtools.testresult.doubles import ExtendedTestResult import subunit @@ -380,10 +377,7 @@ super(TestByTestResultTests, self).setUp() self.log = [] self.result = subunit.test_results.TestByTestResult(self.on_test) - if sys.version_info >= (3, 0): - self.result._now = iter(range(5)).__next__ - else: - self.result._now = iter(range(5)).next + self.result._now = iter(range(5)).__next__ def assertCalled(self, **kwargs): defaults = { @@ -539,10 +533,7 @@ def test_csv_output(self): stream = StringIO() result = subunit.test_results.CsvResult(stream) - if sys.version_info >= (3, 0): - result._now = iter(range(5)).__next__ - else: - result._now = iter(range(5)).next + result._now = iter(range(5)).__next__ result.startTestRun() result.startTest(self) result.addSuccess(self) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/v2.py new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/v2.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/python/subunit/v2.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/python/subunit/v2.py 2022-01-25 19:13:25.000000000 +0100 @@ -15,10 +15,7 @@ # import codecs -utf_8_decode = codecs.utf_8_decode import datetime -from io import UnsupportedOperation -import os import select import struct import sys @@ -30,6 +27,8 @@ import subunit import subunit.iso8601 as iso8601 +utf_8_decode = codecs.utf_8_decode + __all__ = [ 'ByteStreamToStreamResult', 'StreamResultToBytes', @@ -53,7 +52,6 @@ NUL_ELEMENT = b'\0'[0] # Contains True for types for which 'nul in thing' falsely returns false. _nul_test_broken = {} -_PY3 = (sys.version_info >= (3,)) def has_nul(buffer_or_bytes): @@ -232,21 +230,18 @@ # For now, simplest code: join, crc32, join, output content = b''.join(packet) data = content + struct.pack(FMT_32, zlib.crc32(content) & 0xffffffff) - if _PY3: - # On eventlet 0.17.3, GreenIO.write() can make partial write. - # Use a loop to ensure that all bytes are written. - # See also the eventlet issue: - # https://github.com/eventlet/eventlet/issues/248 - view = memoryview(data) - datalen = len(data) - offset = 0 - while offset < datalen: - written = self.output_stream.write(view[offset:]) - if written is None: - break - offset += written - else: - self.output_stream.write(data) + # On eventlet 0.17.3, GreenIO.write() can make partial write. + # Use a loop to ensure that all bytes are written. + # See also the eventlet issue: + # https://github.com/eventlet/eventlet/issues/248 + view = memoryview(data) + datalen = len(data) + offset = 0 + while offset < datalen: + written = self.output_stream.write(view[offset:]) + if written is None: + break + offset += written self.output_stream.flush() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/setup.cfg new/subunit-1.4.0+git.1643134405.a629de4/setup.cfg --- old/subunit-1.4.0+git.1627548288.c87ffbd/setup.cfg 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/setup.cfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -[bdist_wheel] -universal = 1 - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/subunit-1.4.0+git.1627548288.c87ffbd/setup.py new/subunit-1.4.0+git.1643134405.a629de4/setup.py --- old/subunit-1.4.0+git.1627548288.c87ffbd/setup.py 2021-07-29 10:44:48.000000000 +0200 +++ new/subunit-1.4.0+git.1643134405.a629de4/setup.py 2022-01-25 19:13:25.000000000 +0100 @@ -1,36 +1,15 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 + import os.path -try: - # If the user has setuptools / distribute installed, use it - from setuptools import setup -except ImportError: - # Otherwise, fall back to distutils. - from distutils.core import setup - extra = {} -else: - extra = { - 'install_requires': [ - 'extras', - 'testtools>=0.9.34', - ], - 'tests_require': [ - 'fixtures', - 'hypothesis', - 'testscenarios', - ], - 'extras_require': { - 'docs': ['docutils'], - 'test': ['fixtures', 'testscenarios'], - 'test:python_version!="3.2"': ['hypothesis'], - }, - } +from setuptools import setup def _get_version_from_file(filename, start_of_line, split_marker): """Extract version from file, giving last matching value or None""" try: - return [x for x in open(filename) - if x.startswith(start_of_line)][-1].split(split_marker)[1].strip() + return [ + x for x in open(filename) if x.startswith(start_of_line) + ][-1].split(split_marker)[1].strip() except (IOError, IndexError): return None @@ -40,12 +19,14 @@ _get_version_from_file('PKG-INFO', 'Version:', ':') # Must be a development checkout, so use the Makefile or _get_version_from_file('Makefile', 'VERSION', '=') - or "0.0") + or "0.0" +) relpath = os.path.dirname(__file__) if relpath: os.chdir(relpath) + setup( name='python-subunit', version=VERSION, @@ -55,13 +36,12 @@ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - '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', + 'Programming Language :: Python :: 3.10', 'Topic :: Software Development :: Testing', ], keywords='python test streaming', @@ -75,7 +55,7 @@ }, packages=['subunit', 'subunit.tests'], package_dir={'subunit': 'python/subunit'}, - scripts = [ + scripts=[ 'filters/subunit-1to2', 'filters/subunit-2to1', 'filters/subunit-filter', @@ -91,6 +71,18 @@ 'filters/subunit2pyunit', 'filters/tap2subunit', ], - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", - **extra + python_requires=">=3.6", + install_requires=[ + 'extras', + 'testtools>=0.9.34', + ], + tests_require=[ + 'fixtures', + 'hypothesis', + 'testscenarios', + ], + extras_require={ + 'docs': ['docutils'], + 'test': ['fixtures', 'testscenarios', 'hypothesis'], + }, )