Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-zope.testing for openSUSE:Factory checked in at 2023-01-10 14:58:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-zope.testing (Old) and /work/SRC/openSUSE:Factory/.python-zope.testing.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-zope.testing" Tue Jan 10 14:58:51 2023 rev:13 rq:1056372 version:5.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-zope.testing/python-zope.testing.changes 2022-10-12 18:22:27.481329673 +0200 +++ /work/SRC/openSUSE:Factory/.python-zope.testing.new.32243/python-zope.testing.changes 2023-01-10 14:58:53.416910853 +0100 @@ -1,0 +2,16 @@ +Fri Jan 6 11:02:53 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 5.0.1: + * Make wheels no longer universal. + * Backwards incompatible changes + * Drop support for Python 2.7, 3.5, 3.6. + * Drop modules which do not seem to be Python compatible: + + ``zope.testing.loghandler`` + + ``zope.testing.server`` + * Drop doctest option ``IGNORE_EXCEPTION_MODULE_IN_PYTHON2``. + * Remove functions: + + ``zope.testing.renormalizing.strip_dottedname_from_traceback`` + + ``zope.testing.renormalizing.is_dotted_name`` + * Add support for Python 3.11. + +------------------------------------------------------------------- Old: ---- zope.testing-4.10.tar.gz New: ---- zope.testing-5.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-zope.testing.spec ++++++ --- /var/tmp/diff_new_pack.B9QXV2/_old 2023-01-10 14:58:54.024914108 +0100 +++ /var/tmp/diff_new_pack.B9QXV2/_new 2023-01-10 14:58:54.028914129 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-zope.testing # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-zope.testing -Version: 4.10 +Version: 5.0.1 Release: 0 Summary: Zope testing helpers License: ZPL-2.1 ++++++ zope.testing-4.10.tar.gz -> zope.testing-5.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/CHANGES.rst new/zope.testing-5.0.1/CHANGES.rst --- old/zope.testing-4.10/CHANGES.rst 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/CHANGES.rst 2022-12-20 14:19:17.000000000 +0100 @@ -2,6 +2,38 @@ Changes ========= +5.0.1 (2022-12-20) +================== + +- Make wheels no longer universal. + + +5.0 (2022-12-20) +================ + +Backwards incompatible changes +------------------------------ + +- Drop support for Python 2.7, 3.5, 3.6. + +- Drop modules which do not seem to be Python compatible: + + + ``zope.testing.loghandler`` + + ``zope.testing.server`` + +- Drop doctest option ``IGNORE_EXCEPTION_MODULE_IN_PYTHON2``. + +- Remove functions: + + + ``zope.testing.renormalizing.strip_dottedname_from_traceback`` + + ``zope.testing.renormalizing.is_dotted_name`` + +Features +-------- + +- Add support for Python 3.11. + + 4.10 (2022-03-07) ================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/PKG-INFO new/zope.testing-5.0.1/PKG-INFO --- old/zope.testing-4.10/PKG-INFO 2022-03-07 08:06:40.110146000 +0100 +++ new/zope.testing-5.0.1/PKG-INFO 2022-12-20 14:19:18.213709600 +0100 @@ -1,27 +1,23 @@ Metadata-Version: 2.1 Name: zope.testing -Version: 4.10 +Version: 5.0.1 Summary: Zope testing helpers Home-page: https://github.com/zopefoundation/zope.testing Author: Zope Foundation and Contributors Author-email: zope-...@zope.org License: ZPL 2.1 Keywords: zope testing doctest RENormalizing OutputChecker timeout logging -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Framework :: Zope :: 3 @@ -127,6 +123,38 @@ Changes ========= +5.0.1 (2022-12-20) +================== + +- Make wheels no longer universal. + + +5.0 (2022-12-20) +================ + +Backwards incompatible changes +------------------------------ + +- Drop support for Python 2.7, 3.5, 3.6. + +- Drop modules which do not seem to be Python compatible: + + + ``zope.testing.loghandler`` + + ``zope.testing.server`` + +- Drop doctest option ``IGNORE_EXCEPTION_MODULE_IN_PYTHON2``. + +- Remove functions: + + + ``zope.testing.renormalizing.strip_dottedname_from_traceback`` + + ``zope.testing.renormalizing.is_dotted_name`` + +Features +-------- + +- Add support for Python 3.11. + + 4.10 (2022-03-07) ================= @@ -670,5 +698,3 @@ - Release a separate project corresponding to the version of ``zope.testing`` shipped as part of the Zope 3.2.0 release. - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/docs/api/index.rst new/zope.testing-5.0.1/docs/api/index.rst --- old/zope.testing-4.10/docs/api/index.rst 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/docs/api/index.rst 2022-12-20 14:19:17.000000000 +0100 @@ -23,10 +23,6 @@ =========================== .. automodule:: zope.testing.loggingsupport -zope.testing.loghandler -======================= -.. automodule:: zope.testing.loghandler - zope.testing.module =================== .. automodule:: zope.testing.module @@ -35,10 +31,6 @@ ========================== .. automodule:: zope.testing.renormalizing -zope.testing.server -=================== -.. automodule:: zope.testing.server - zope.testing.setupstack ======================= .. automodule:: zope.testing.setupstack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/setup.cfg new/zope.testing-5.0.1/setup.cfg --- old/zope.testing-4.10/setup.cfg 2022-03-07 08:06:40.110674000 +0100 +++ new/zope.testing-5.0.1/setup.cfg 2022-12-20 14:19:18.214687300 +0100 @@ -1,5 +1,5 @@ [bdist_wheel] -universal = 1 +universal = 0 [flake8] doctests = 1 @@ -12,6 +12,17 @@ docs/_build/doctest/* docs/_build/html/_sources/api/* +[isort] +force_single_line = True +combine_as_imports = True +sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER +known_third_party = six, docutils, pkg_resources +known_zope = +known_first_party = +default_section = ZOPE +line_length = 79 +lines_after_imports = 2 + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/setup.py new/zope.testing-5.0.1/setup.py --- old/zope.testing-4.10/setup.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/setup.py 2022-12-20 14:19:17.000000000 +0100 @@ -19,6 +19,7 @@ """Setup for zope.testing package """ import os + from setuptools import setup @@ -32,7 +33,7 @@ setup( name='zope.testing', - version='4.10', + version='5.0.1', url='https://github.com/zopefoundation/zope.testing', license='ZPL 2.1', description='Zope testing helpers', @@ -45,15 +46,12 @@ "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "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", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Framework :: Zope :: 3", @@ -81,7 +79,6 @@ 'repoze.sphinx.autointerface', 'zope.exceptions', 'zope.interface', - 'mock; python_version == "2.7"' ], }, include_package_data=True, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/cleanup.py new/zope.testing-5.0.1/src/zope/testing/cleanup.py --- old/zope.testing-4.10/src/zope/testing/cleanup.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/cleanup.py 2022-12-20 14:19:17.000000000 +0100 @@ -48,7 +48,7 @@ _cleanups.append((func, args, kw)) -class CleanUp(object): +class CleanUp: """Mix-in class providing clean-up setUp and tearDown routines.""" def cleanUp(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/doctestcase.py new/zope.testing-5.0.1/src/zope/testing/doctestcase.py --- old/zope.testing-4.10/src/zope/testing/doctestcase.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/doctestcase.py 2022-12-20 14:19:17.000000000 +0100 @@ -8,6 +8,7 @@ import sys import types + __all__ = [ 'doctestmethod', 'method', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/exceptions.py new/zope.testing-5.0.1/src/zope/testing/exceptions.py --- old/zope.testing-4.10/src/zope/testing/exceptions.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/exceptions.py 2022-12-20 14:19:17.000000000 +0100 @@ -15,6 +15,8 @@ """ import warnings + + # Tell people to use the builtin module instead. warnings.warn( 'zope.testing.exceptions is deprecated in favour of ' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/formparser.py new/zope.testing-5.0.1/src/zope/testing/formparser.py --- old/zope.testing-4.10/src/zope/testing/formparser.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/formparser.py 2022-12-20 14:19:17.000000000 +0100 @@ -15,15 +15,8 @@ __docformat__ = "reStructuredText" -try: - import html.parser as HTMLParser -except ImportError: # Python 2 - import HTMLParser - -try: - import urllib.parse as urlparse -except ImportError: # Python 2 - import urlparse +import html.parser as HTMLParser +import urllib.parse as urlparse def parse(data, base=None): @@ -36,7 +29,7 @@ return parser.parse() -class FormParser(object): +class FormParser: """ The parser. """ @@ -194,7 +187,7 @@ # `zope.testbrowser` package. def __init__(self, name, id, method, action, enctype): - super(Form, self).__init__() + super().__init__() self.name = name self.id = id self.method = method @@ -202,7 +195,7 @@ self.enctype = enctype -class Input(object): +class Input: """Input element.""" rows = None @@ -210,7 +203,7 @@ def __init__(self, name, id, type, value, checked, disabled, readonly, src, size, maxlength): - super(Input, self).__init__() + super().__init__() self.name = name self.id = id self.type = type @@ -227,19 +220,19 @@ """Select element.""" def __init__(self, name, id, disabled, multiple, size): - super(Select, self).__init__(name, id, "select", None, None, - disabled, None, None, size, None) + super().__init__(name, id, "select", None, None, + disabled, None, None, size, None) self.options = [] self.multiple = multiple if multiple: self.value = [] -class Option(object): +class Option: """Individual value representation for a select element.""" def __init__(self, id, value, selected, label, disabled): - super(Option, self).__init__() + super().__init__() self.id = id self.value = value self.selected = selected diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/loggingsupport.py new/zope.testing-5.0.1/src/zope/testing/loggingsupport.py --- old/zope.testing-4.10/src/zope/testing/loggingsupport.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/loggingsupport.py 2022-12-20 14:19:17.000000000 +0100 @@ -69,7 +69,7 @@ def __str__(self): return '\n'.join( - "%s %s\n %s" % ( + "{} {}\n {}".format( record.name, record.levelname, '\n'.join( line diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/loghandler.py new/zope.testing-5.0.1/src/zope/testing/loghandler.py --- old/zope.testing-4.10/src/zope/testing/loghandler.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/loghandler.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +0,0 @@ -############################################################################## -# -# Copyright (c) 2003 Zope Foundation and Contributors. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# -############################################################################## -"""logging handler for tests that check logging output. - -.. caution:: This is deprecated and may not work on Python 3. - -""" -import logging -import warnings - - -warnings.warn( - 'zope.testing.loghandler.Handler is deprecated. It probably' - ' does not work on Python 3.', DeprecationWarning, stacklevel=2) - - -class Handler(logging.Handler): - """Handler for use with `unittest.TestCase` objects. - - The handler takes a ``TestCase`` instance as a constructor argument. - It can be registered with one or more loggers and collects log - records they generate. - - The `assertLogsMessage` and `failIfLogsMessage` methods can be - used to check the logger output and causes the test to fail as - appropriate. - """ - - def __init__(self, testcase, propagate=False): - logging.Handler.__init__(self) - self.records = [] - # loggers stores (logger, propagate) tuples - self.loggers = [] - self.closed = False - self.propagate = propagate - self.testcase = testcase - - def close(self): - """Remove handler from any loggers it was added to.""" - if self.closed: - return - for logger, propagate in self.loggers: - logger.removeHandler(self) - logger.propagate = propagate - self.closed = True - - def add(self, name): - """Add handler to logger named name.""" - logger = logging.getLogger(name) - old_prop = logger.propagate - logger.addHandler(self) - if self.propagate: - logger.propagate = 1 - else: - logger.propagate = 0 - self.loggers.append((logger, old_prop)) - - def emit(self, record): - self.records.append(record) - - def assertLogsMessage(self, msg, level=None): - """ - Check that a record whose message equals *msg* - (and optionally at *level*) has been emitted, failing - if not. - """ - for r in self.records: - if r.getMessage() == msg: - if level is not None and r.levelno == level: - return - msg = "No log message contained %r" % msg - if level is not None: - msg += " at level %d" % level - self.testcase.fail(msg) - - def failIfLogsMessage(self, msg): - """ - Check that a record whose message equals *msg* - has **not** been emitted, failing if it has. - """ - for r in self.records: - if r.getMessage() == msg: - self.testcase.fail("Found log message %r" % msg) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/module.py new/zope.testing-5.0.1/src/zope/testing/module.py --- old/zope.testing-4.10/src/zope/testing/module.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/module.py 2022-12-20 14:19:17.000000000 +0100 @@ -18,13 +18,14 @@ import sys + __all__ = [ 'setUp', 'tearDown', ] -class FakeModule(object): +class FakeModule: def __init__(self, dict): self.__dict = dict diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/module.txt new/zope.testing-5.0.1/src/zope/testing/module.txt --- old/zope.testing-4.10/src/zope/testing/module.txt 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/module.txt 2022-12-20 14:19:17.000000000 +0100 @@ -90,7 +90,7 @@ >>> import fake Traceback (most recent call last): ... - ImportError: No module named fake + ModuleNotFoundError: No module named 'fake' If we enter a dotted name, it will actually try to place the fake module in that dotted name: @@ -111,7 +111,7 @@ >>> import zope.testing.unlikelymodulename Traceback (most recent call last): ... - ImportError: No module named unlikelymodulename + ModuleNotFoundError: No module named 'zope.testing.unlikelymodulename' This only works for packages that already exist: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/renormalizing.py new/zope.testing-5.0.1/src/zope/testing/renormalizing.py --- old/zope.testing-4.10/src/zope/testing/renormalizing.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/renormalizing.py 2022-12-20 14:19:17.000000000 +0100 @@ -17,23 +17,6 @@ See :doc:`../renormalizing` for documentation. """ import doctest -import re -import sys - - -IGNORE_EXCEPTION_MODULE_IN_PYTHON2 = doctest.register_optionflag( - 'IGNORE_EXCEPTION_MODULE_IN_PYTHON2') -IGNORE_EXCEPTION_MODULE_IN_PYTHON2_HINT = """\ -=============================================================== -HINT: - The optionflag IGNORE_EXCEPTION_MODULE_IN_PYTHON2 is set. - You seem to test traceback output. - If you are indeed, make sure to use the full dotted name of - the exception class like Python 3 displays, - even though you are running the tests in Python 2. - The exception message needs to be last line (and thus not - split over multiple lines). -===============================================================""" class OutputChecker(doctest.OutputChecker): @@ -66,18 +49,9 @@ if doctest.OutputChecker.check_output(self, want, got, optionflags): return True - - if sys.version_info[0] < 3: # pragma: PY2 - if optionflags & IGNORE_EXCEPTION_MODULE_IN_PYTHON2: - want = strip_dottedname_from_traceback(want) - if doctest.OutputChecker.check_output( - self, want, got, optionflags): - return True - return False def output_difference(self, example, got, optionflags): - want = example.want # If want is empty, use original outputter. This is useful @@ -98,11 +72,6 @@ # temporarily hack example with normalized want: example.want = want - if sys.version_info[0] < 3: # pragma: PY2 - if optionflags & IGNORE_EXCEPTION_MODULE_IN_PYTHON2: - if maybe_a_traceback(got) is not None: - got += IGNORE_EXCEPTION_MODULE_IN_PYTHON2_HINT - result = doctest.OutputChecker.output_difference( self, example, got, optionflags) example.want = original @@ -111,58 +80,3 @@ RENormalizing = OutputChecker - - -def is_dotted_name(name): - if sys.version_info[0] >= 3: # pragma: PY3 - return ( - name and - all(element.isidentifier() for element in name.split('.'))) - else: # pragma: PY2 - # Python 2 lacked str.isidentifier, but also restricted identifiers - # to ASCII so a regex match is straightforward. - match = re.match( - r'^(?:[A-Za-z_][A-Za-z0-9_]*\.)*[A-Za-z_][A-Za-z0-9_]*$', name) - return match is not None - - -def maybe_a_traceback(string): - # We wanted to confirm more strictly we're dealing with a traceback here. - # However, doctest will preprocess exception output. It gets rid of the - # the stack trace and the "Traceback (most recent call last)"-part. It - # passes only the exception message to the checker. - if not string: - return None - - lines = string.splitlines() - last = lines[-1] - if not last: - return None - words = last.split(' ') - first = words[0] - if len(words) > 1 and not first.endswith(':'): - return None - # If IGNORE_EXCEPTION_MODULE_IN_PYTHON2 was applied to an entire file, - # then this may run on strings that aren't the exception message part of - # a traceback. The doctest interface makes it impossible to detect this - # reasonably, so do our best to restrict this to only lines that start - # with something that looks like a Python dotted name. It's best to - # apply IGNORE_EXCEPTION_MODULE_IN_PYTHON2 only to examples that need - # it. - if not is_dotted_name(first[:-1]): - return None - - return lines, last, words, first - - -def strip_dottedname_from_traceback(string): - maybe = maybe_a_traceback(string) - if maybe is None: - return string - - lines, last, words, first = maybe - name = first.split('.')[-1] - words[0] = name - last = ' '.join(words) - lines[-1] = last - return '\n'.join(lines) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/renormalizing.txt new/zope.testing-5.0.1/src/zope/testing/renormalizing.txt --- old/zope.testing-4.10/src/zope/testing/renormalizing.txt 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/renormalizing.txt 2022-12-20 14:19:17.000000000 +0100 @@ -238,67 +238,3 @@ Traceback (most recent call last): ... TypeError: unsupported operand type(s) for +: ... - -Using the 2to3 exception normalization: - - >>> from zope.testing.renormalizing import ( - ... IGNORE_EXCEPTION_MODULE_IN_PYTHON2) - >>> checker = OutputChecker() - >>> want = """\ - ... Traceback (most recent call last): - ... foo.bar.FooBarError: requires at least one argument.""" - >>> got = """\ - ... Traceback (most recent call last): - ... FooBarError: requires at least one argument.""" - >>> result = checker.check_output( - ... want, got, IGNORE_EXCEPTION_MODULE_IN_PYTHON2) - >>> import sys - >>> if sys.version_info[0] < 3: - ... expected = True - ... else: - ... expected = False - >>> result == expected - True - -When reporting a failing test and running in Python 2, the normalizer tries -to be helpful by explaining how to test for exceptions in the traceback output. - - >>> want = """\ - ... Traceback (most recent call last): - ... foo.bar.FooBarErrorXX: requires at least one argument. - ... """ - >>> got = """\ - ... Traceback (most recent call last): - ... FooBarError: requires at least one argument. - ... """ - >>> checker.check_output(want, got, IGNORE_EXCEPTION_MODULE_IN_PYTHON2) - False - >>> from doctest import Example - >>> example = Example('dummy', want) - >>> result = checker.output_difference( - ... example, got, IGNORE_EXCEPTION_MODULE_IN_PYTHON2) - >>> output = """\ - ... Expected: - ... Traceback (most recent call last): - ... foo.bar.FooBarErrorXX: requires at least one argument. - ... Got: - ... Traceback (most recent call last): - ... FooBarError: requires at least one argument. - ... """ - >>> hint = """\ - ... =============================================================== - ... HINT: - ... The optionflag IGNORE_EXCEPTION_MODULE_IN_PYTHON2 is set. - ... You seem to test traceback output. - ... If you are indeed, make sure to use the full dotted name of - ... the exception class like Python 3 displays, - ... even though you are running the tests in Python 2. - ... The exception message needs to be last line (and thus not - ... split over multiple lines). - ... ===============================================================""" - >>> if sys.version_info[0] < 3: - ... expected = output + hint - ... else: - ... expected = output - >>> result == expected - True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/server.py new/zope.testing-5.0.1/src/zope/testing/server.py --- old/zope.testing-4.10/src/zope/testing/server.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/server.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,116 +0,0 @@ -############################################################################## -# -# Copyright (c) 2007 Zope Foundation and Contributors. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE. -# -############################################################################## -"""Functional test server to interactively inspect the state of the system. - -You can run it in a functional test by adding a line like this: - - startServer(http, url, "username", "password") - -http is an instance of HTTPCaller, url is the url that will be opened -in the browser, the username and password are optional. When you're -done with inspecting the application press Ctrl+C to continue with the -functional test. -""" -from __future__ import print_function - -import sys -import warnings -import webbrowser -# XXX: I don't think this module works on Python 3! - -try: # pragma: PY3 - from urllib import parse as urlparse - from http.server import BaseHTTPRequestHandler, HTTPServer -except ImportError: # pragma: PY2 - import urlparse - from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer - - -def makeRequestHandler(http, user=None, password=None): # pragma: PY2 - warnings.warn( - 'zope.testing.server.makeRequestHandler is deprecated. It probably' - ' does not work on Python 3.', DeprecationWarning, stacklevel=2) - - class FunctionalTestRequestHandler(BaseHTTPRequestHandler): - - def do_GET(self): - request = self.raw_requestline - if user and password: - # Authentication is built in, as there is no fluent - # way of transferring session from functional test to - # the real browser - request += "Authorization: Basic %s:%s\r\n" % (user, password) - - # Write headers to the request - for header in self.headers.headers: - request += header - request += '\r\n' - - if self.headers.get('Content-Length'): - data = self.rfile.read(int(self.headers.get('Content-Length'))) - request += data - else: - # if no content-length was set - read until the last - # char, then finish - self.request.setblocking(0) - while True: - try: - char = self.rfile.read() - except Exception: # XXX: should probably be IOError? - break - request += char - - response = http(request) - self.wfile.write(response) - - do_POST = do_GET - - return FunctionalTestRequestHandler - - -def addPortToURL(url, port): - """Add a port number to the url. - - >>> from zope.testing.server import addPortToURL - >>> addPortToURL('http://localhost/foo/bar/baz.html', 3000) - 'http://localhost:3000/foo/bar/baz.html' - >>> addPortToURL('http://foo.bar.com/index.html?param=some-value', 555) - 'http://foo.bar.com:555/index.html?param=some-value' - - >>> addPortToURL('http://localhost:666/index.html', 555) - 'http://localhost:555/index.html' - - """ - (scheme, netloc, url, query, fragment) = urlparse.urlsplit(url) - netloc = netloc.split(':')[0] - netloc = "%s:%s" % (netloc, port) - url = urlparse.urlunsplit((scheme, netloc, url, query, fragment)) - return url - - -def startServer(http, url, user=None, password=None, port=8000): # pragma: PY2 - warnings.warn( - 'zope.testing.server.startServer is deprecated. It probably' - ' does not work on Python 3.', DeprecationWarning, stacklevel=2) - try: - server_address = ('', port) - requestHandler = makeRequestHandler(http, user, password) - url = addPortToURL(url, port) - httpd = HTTPServer(server_address, requestHandler) - # XXX we rely on browser being slower than our server - webbrowser.open(url) - print('Starting HTTP server...', file=sys.stderr) - httpd.serve_forever() - except KeyboardInterrupt: - print('Stopped HTTP server.', file=sys.stderr) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/setupstack.py new/zope.testing-5.0.1/src/zope/testing/setupstack.py --- old/zope.testing-4.10/src/zope/testing/setupstack.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/setupstack.py 2022-12-20 14:19:17.000000000 +0100 @@ -110,10 +110,7 @@ def _get_mock(): # A hook for the setupstack.txt doctest : - try: - from unittest import mock as mock_module - except ImportError: - import mock as mock_module + from unittest import mock as mock_module return mock_module @@ -124,8 +121,6 @@ with the *args* and *kw* given, and returns the result. This will be torn down when the *test* is torn down. - - .. note:: On Python 2, you must manually install the ``mock`` package. """ mock_module = _get_mock() return context_manager(test, mock_module.patch(*args, **kw)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/test_renormalizing.py new/zope.testing-5.0.1/src/zope/testing/test_renormalizing.py --- old/zope.testing-4.10/src/zope/testing/test_renormalizing.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/test_renormalizing.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,104 +0,0 @@ -import sys -import textwrap -import unittest - -from zope.testing.renormalizing import ( - is_dotted_name, - strip_dottedname_from_traceback, -) - - -class Exception2To3(unittest.TestCase): - - def test_is_dotted_name_ascii_no_dots(self): - self.assertTrue(is_dotted_name('FooBarError')) - - def test_is_dotted_name_ascii_dots(self): - self.assertTrue(is_dotted_name('foo.bar.FooBarError')) - - def test_is_dotted_name_unicode_no_dots(self): - result = is_dotted_name(u'FooB\xe1rError') - if sys.version_info[0] >= 3: # pragma: PY3 - self.assertTrue(result) - else: # pragma: PY2 - self.assertFalse(result) - - def test_is_dotted_name_unicode_dots(self): - result = is_dotted_name(u'foo.b\xe1r.FooB\xe1rError') - if sys.version_info[0] >= 3: # pragma: PY3 - self.assertTrue(result) - else: # pragma: PY2 - self.assertFalse(result) - - def test_is_dotted_name_ellipsis(self): - self.assertFalse(is_dotted_name('...')) - - def test_is_dotted_name_not_identifier(self): - self.assertFalse(is_dotted_name('foo=bar')) - - def test_strip_dottedname(self): - string = textwrap.dedent("""\ - Traceback (most recent call last): - foo.bar.FooBarError: requires at least one argument.""") - expected = textwrap.dedent("""\ - Traceback (most recent call last): - FooBarError: requires at least one argument.""") - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_strip_dottedname_without_exception_arguments(self): - string = textwrap.dedent("""\ - Traceback (most recent call last): - foo.bar.FooBarError""") - expected = textwrap.dedent("""\ - Traceback (most recent call last): - FooBarError""") - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_no_dots_in_name(self): - string = textwrap.dedent("""\ - Traceback (most recent call last): - FooBarError: requires at least one argument.""") - expected = textwrap.dedent("""\ - Traceback (most recent call last): - FooBarError: requires at least one argument.""") - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_no_colon_in_first_word(self): - string = textwrap.dedent("""\ - Traceback (most recent call last): - foo.bar.FooBarError requires at least one argument.""") - expected = textwrap.dedent("""\ - Traceback (most recent call last): - foo.bar.FooBarError requires at least one argument.""") - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_input_empty(self): - string = '' - expected = '' - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_input_spaces(self): - string = ' ' - expected = ' ' - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_input_ellipsis(self): - string = '...' - expected = '...' - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_input_last_line_not_dotted_name(self): - string = 'foo=bar' - expected = 'foo=bar' - self.assertEqual(expected, strip_dottedname_from_traceback(string)) - - def test_last_line_empty(self): - string = textwrap.dedent("""\ - Traceback (most recent call last): - - """) - expected = textwrap.dedent("""\ - Traceback (most recent call last): - - """) - self.assertEqual(expected, strip_dottedname_from_traceback(string)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/testrunner.py new/zope.testing-5.0.1/src/zope/testing/testrunner.py --- old/zope.testing-4.10/src/zope/testing/testrunner.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/testrunner.py 2022-12-20 14:19:17.000000000 +0100 @@ -1,10 +1,13 @@ import warnings + + warnings.warn('zope.testing.testrunner is deprecated in favour of ' 'zope.testrunner', DeprecationWarning, stacklevel=2) try: - from zope import testrunner import zope.testing + from zope import testrunner + # Now replace this module with the right one: zope.testing.testrunner = testrunner except ImportError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/tests.py new/zope.testing-5.0.1/src/zope/testing/tests.py --- old/zope.testing-4.10/src/zope/testing/tests.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/tests.py 2022-12-20 14:19:17.000000000 +0100 @@ -12,11 +12,11 @@ """Tests for the testing framework. """ import doctest -import sys import re +import sys import unittest + from zope.testing import renormalizing -from zope.testing.test_renormalizing import Exception2To3 def print_(*args): @@ -29,37 +29,22 @@ def test_suite(): suite = unittest.TestSuite(( - doctest.DocFileSuite( - 'module.txt', - # Python 3.3 changed exception messaging: - # https://bugs.launchpad.net/zope.testing/+bug/1055720 - # and then Python 3.6 introduced ImportError subclasses - checker=renormalizing.RENormalizing([ - (re.compile('ModuleNotFoundError:'), 'ImportError:'), - (re.compile( - "No module named '?zope.testing.unlikelymodulename'?"), - 'No module named unlikelymodulename'), - (re.compile("No module named '?fake'?"), - 'No module named fake')])), + doctest.DocFileSuite('module.txt'), doctest.DocFileSuite('loggingsupport.txt', setUp=setUp), doctest.DocFileSuite('renormalizing.txt', setUp=setUp), doctest.DocFileSuite('setupstack.txt', setUp=setUp), - doctest.DocFileSuite( - 'wait.txt', setUp=setUp, - checker=renormalizing.RENormalizing([ - # For Python 3.4. - (re.compile('zope.testing.wait.TimeOutWaitingFor: '), - 'TimeOutWaitingFor: '), - # For Python 3.5 - (re.compile('zope.testing.wait.Wait.TimeOutWaitingFor: '), - 'TimeOutWaitingFor: '), - ]) - ), + doctest.DocFileSuite('wait.txt', setUp=setUp) )) - suite.addTests(doctest.DocFileSuite('doctestcase.txt')) + suite.addTests( + doctest.DocFileSuite( + 'doctestcase.txt', + checker=renormalizing.RENormalizing([ + # for Python 3.11+ + (re.compile(r'\(tests\.MyTest\.test.?\)'), '(tests.MyTest)'), + (re.compile(r'\(tests.MoreTests.test_.*\)'), + '(tests.MoreTests)') + ]))) suite.addTests(doctest.DocFileSuite('cleanup.txt')) - suite.addTest(unittest.makeSuite(Exception2To3)) - suite.addTests(doctest.DocTestSuite('zope.testing.server')) suite.addTests(doctest.DocFileSuite('formparser.txt', setUp=setUp)) return suite diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/wait.py new/zope.testing-5.0.1/src/zope/testing/wait.py --- old/zope.testing-4.10/src/zope/testing/wait.py 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/wait.py 2022-12-20 14:19:17.000000000 +0100 @@ -21,7 +21,7 @@ import time -class Wait(object): +class Wait: """ A callable object that polls until *func* returns a true value, sleeping *wait* seconds between diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope/testing/wait.txt new/zope.testing-5.0.1/src/zope/testing/wait.txt --- old/zope.testing-4.10/src/zope/testing/wait.txt 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope/testing/wait.txt 2022-12-20 14:19:17.000000000 +0100 @@ -23,7 +23,7 @@ >>> wait((lambda : False), timeout=.01) Traceback (most recent call last): ... - TimeOutWaitingFor: <lambda> + zope.testing.wait.Wait.TimeOutWaitingFor: <lambda> ``wait`` has some keyword options: @@ -54,14 +54,14 @@ ... pass Traceback (most recent call last): ... - TimeOutWaitingFor: no_way + zope.testing.wait.Wait.TimeOutWaitingFor: no_way >>> @wait(timeout=.01) ... def no_way(): ... "never true" Traceback (most recent call last): ... - TimeOutWaitingFor: never true + zope.testing.wait.Wait.TimeOutWaitingFor: never true .. more tests @@ -72,7 +72,7 @@ ... "never true" Traceback (most recent call last): ... - TimeOutWaitingFor: dang + zope.testing.wait.Wait.TimeOutWaitingFor: dang >>> .01 < (time.time() - now) < .03 True @@ -166,4 +166,4 @@ ... state.append(0) Traceback (most recent call last): ... - TimeOutWaitingFor: _ + zope.testing.wait.Wait.TimeOutWaitingFor: _ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope.testing.egg-info/PKG-INFO new/zope.testing-5.0.1/src/zope.testing.egg-info/PKG-INFO --- old/zope.testing-4.10/src/zope.testing.egg-info/PKG-INFO 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope.testing.egg-info/PKG-INFO 2022-12-20 14:19:18.000000000 +0100 @@ -1,27 +1,23 @@ Metadata-Version: 2.1 Name: zope.testing -Version: 4.10 +Version: 5.0.1 Summary: Zope testing helpers Home-page: https://github.com/zopefoundation/zope.testing Author: Zope Foundation and Contributors Author-email: zope-...@zope.org License: ZPL 2.1 Keywords: zope testing doctest RENormalizing OutputChecker timeout logging -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.5 -Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Framework :: Zope :: 3 @@ -127,6 +123,38 @@ Changes ========= +5.0.1 (2022-12-20) +================== + +- Make wheels no longer universal. + + +5.0 (2022-12-20) +================ + +Backwards incompatible changes +------------------------------ + +- Drop support for Python 2.7, 3.5, 3.6. + +- Drop modules which do not seem to be Python compatible: + + + ``zope.testing.loghandler`` + + ``zope.testing.server`` + +- Drop doctest option ``IGNORE_EXCEPTION_MODULE_IN_PYTHON2``. + +- Remove functions: + + + ``zope.testing.renormalizing.strip_dottedname_from_traceback`` + + ``zope.testing.renormalizing.is_dotted_name`` + +Features +-------- + +- Add support for Python 3.11. + + 4.10 (2022-03-07) ================= @@ -670,5 +698,3 @@ - Release a separate project corresponding to the version of ``zope.testing`` shipped as part of the Zope 3.2.0 release. - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope.testing.egg-info/SOURCES.txt new/zope.testing-5.0.1/src/zope.testing.egg-info/SOURCES.txt --- old/zope.testing-4.10/src/zope.testing.egg-info/SOURCES.txt 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope.testing.egg-info/SOURCES.txt 2022-12-20 14:19:18.000000000 +0100 @@ -39,19 +39,16 @@ src/zope/testing/formparser.txt src/zope/testing/loggingsupport.py src/zope/testing/loggingsupport.txt -src/zope/testing/loghandler.py src/zope/testing/module.py src/zope/testing/module.txt src/zope/testing/renormalizing.py src/zope/testing/renormalizing.txt -src/zope/testing/server.py src/zope/testing/setupstack.py src/zope/testing/setupstack.txt src/zope/testing/test-1.txt src/zope/testing/test4.txt src/zope/testing/test4e.txt src/zope/testing/test4f.txt -src/zope/testing/test_renormalizing.py src/zope/testing/testrunner.py src/zope/testing/tests.py src/zope/testing/wait.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/src/zope.testing.egg-info/requires.txt new/zope.testing-5.0.1/src/zope.testing.egg-info/requires.txt --- old/zope.testing-4.10/src/zope.testing.egg-info/requires.txt 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/src/zope.testing.egg-info/requires.txt 2022-12-20 14:19:18.000000000 +0100 @@ -6,8 +6,5 @@ zope.exceptions zope.interface -[docs:python_version == "2.7"] -mock - [test] zope.testrunner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zope.testing-4.10/tox.ini new/zope.testing-5.0.1/tox.ini --- old/zope.testing-4.10/tox.ini 2022-03-07 08:06:39.000000000 +0100 +++ new/zope.testing-5.0.1/tox.ini 2022-12-20 14:19:17.000000000 +0100 @@ -4,14 +4,11 @@ minversion = 3.18 envlist = lint - py27 - py35 - py36 py37 py38 py39 py310 - pypy + py311 pypy3 docs coverage @@ -21,7 +18,7 @@ deps = commands = zope-testrunner --test-path=src {posargs:-vc} - !py27-!pypy: sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest + sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest extras = test docs @@ -29,15 +26,26 @@ [testenv:lint] basepython = python3 skip_install = true +commands = + isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py + flake8 src setup.py + check-manifest + check-python-versions deps = - flake8 check-manifest check-python-versions >= 0.19.1 wheel + flake8 + isort + +[testenv:isort-apply] +basepython = python3 +skip_install = true +commands_pre = +deps = + isort commands = - flake8 src setup.py - check-manifest - check-python-versions + isort {toxinidir}/src {toxinidir}/setup.py [] [testenv:docs] basepython = python3 @@ -58,17 +66,16 @@ mkdir -p {toxinidir}/parts/htmlcov coverage run -m zope.testrunner --test-path=src {posargs:-vc} coverage run -a -m sphinx -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest - coverage html - coverage report -m --fail-under=98 + coverage html --ignore-errors + coverage report --ignore-errors --show-missing --fail-under=97 [coverage:run] branch = True plugins = coverage_python_version source = zope.testing -# omit files which just contain BBB code or are not Python 3 compatible: +# omit files which just contain BBB code: omit = src/zope/testing/exceptions.py - src/zope/testing/loghandler.py src/zope/testing/testrunner.py [coverage:report]