Hello community,
here is the log from the commit of package python-zope.testbrowser for
openSUSE:Factory checked in at 2019-11-07 23:17:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-zope.testbrowser (Old)
and /work/SRC/openSUSE:Factory/.python-zope.testbrowser.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-zope.testbrowser"
Thu Nov 7 23:17:12 2019 rev:11 rq:745975 version:5.4.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-zope.testbrowser/python-zope.testbrowser.changes
2019-07-22 17:19:02.189927604 +0200
+++
/work/SRC/openSUSE:Factory/.python-zope.testbrowser.new.2990/python-zope.testbrowser.changes
2019-11-07 23:17:17.880585478 +0100
@@ -1,0 +2,7 @@
+Wed Nov 6 12:01:55 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 5.4.0:
+ * Fix a bug where browser.reload() would not follow redirects or raise
exceptions for bad HTTP statuses. See issue 75.
+ * Add Python 3.8 support. See issue 80.
+
+-------------------------------------------------------------------
Old:
----
zope.testbrowser-5.3.3.tar.gz
New:
----
zope.testbrowser-5.4.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-zope.testbrowser.spec ++++++
--- /var/tmp/diff_new_pack.IxHVyS/_old 2019-11-07 23:17:19.136586854 +0100
+++ /var/tmp/diff_new_pack.IxHVyS/_new 2019-11-07 23:17:19.144586863 +0100
@@ -18,11 +18,10 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-zope.testbrowser
-Version: 5.3.3
+Version: 5.4.0
Release: 0
Summary: Programmable browser for functional black-box tests
License: ZPL-2.1
-Group: Development/Languages/Python
URL: https://github.com/zopefoundation/zope.testbrowser
Source:
https://files.pythonhosted.org/packages/source/z/zope.testbrowser/zope.testbrowser-%{version}.tar.gz
Patch0: zope.testbrowser-remove-bad-test.patch
++++++ zope.testbrowser-5.3.3.tar.gz -> zope.testbrowser-5.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.3/.coveragerc
new/zope.testbrowser-5.4.0/.coveragerc
--- old/zope.testbrowser-5.3.3/.coveragerc 2019-07-02 13:25:02.000000000
+0200
+++ new/zope.testbrowser-5.4.0/.coveragerc 2019-11-01 10:44:52.000000000
+0100
@@ -4,3 +4,9 @@
[report]
precision = 2
+
+[paths]
+source =
+ src/
+ .tox/*/lib/python*/site-packages/
+ .tox/pypy*/site-packages/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.3/.travis.yml
new/zope.testbrowser-5.4.0/.travis.yml
--- old/zope.testbrowser-5.3.3/.travis.yml 2019-07-02 13:25:02.000000000
+0200
+++ new/zope.testbrowser-5.4.0/.travis.yml 2019-11-01 10:44:52.000000000
+0100
@@ -3,13 +3,10 @@
- 2.7
- 3.5
- 3.6
+ - 3.7
+ - 3.8
- pypy
- pypy3
-matrix:
- include:
- - python: "3.7"
- dist: xenial
- sudo: true
install:
- pip install coverage coveralls
- pip install zope.testrunner flake8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.3/CHANGES.rst
new/zope.testbrowser-5.4.0/CHANGES.rst
--- old/zope.testbrowser-5.3.3/CHANGES.rst 2019-07-02 13:25:02.000000000
+0200
+++ new/zope.testbrowser-5.4.0/CHANGES.rst 2019-11-01 10:44:52.000000000
+0100
@@ -2,6 +2,17 @@
CHANGES
=======
+5.4.0 (2019-11-01)
+------------------
+
+- Fix a bug where browser.reload() would not follow redirects or raise
+ exceptions for bad HTTP statuses. See `issue 75
+ <https://zopefoundation/zope.testbrowser/issue/75>`_.
+
+- Add Python 3.8 support. See `issue 80
+ <https://github.com/zopefoundation/zope.testbrowser/issue/80>`_.
+
+
5.3.3 (2019-07-02)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.3/PKG-INFO
new/zope.testbrowser-5.4.0/PKG-INFO
--- old/zope.testbrowser-5.3.3/PKG-INFO 2019-07-02 13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/PKG-INFO 2019-11-01 10:44:52.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: zope.testbrowser
-Version: 5.3.3
+Version: 5.4.0
Summary: Programmable browser for functional black-box tests
Home-page: https://github.com/zopefoundation/zope.testbrowser
Author: Zope Corporation and Contributors
@@ -33,6 +33,17 @@
CHANGES
=======
+ 5.4.0 (2019-11-01)
+ ------------------
+
+ - Fix a bug where browser.reload() would not follow redirects or raise
+ exceptions for bad HTTP statuses. See `issue 75
+ <https://zopefoundation/zope.testbrowser/issue/75>`_.
+
+ - Add Python 3.8 support. See `issue 80
+ <https://github.com/zopefoundation/zope.testbrowser/issue/80>`_.
+
+
5.3.3 (2019-07-02)
------------------
@@ -534,6 +545,7 @@
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 :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.3/setup.py
new/zope.testbrowser-5.4.0/setup.py
--- old/zope.testbrowser-5.3.3/setup.py 2019-07-02 13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/setup.py 2019-11-01 10:44:52.000000000 +0100
@@ -27,7 +27,7 @@
setup(
name='zope.testbrowser',
- version='5.3.3',
+ version='5.4.0',
url='https://github.com/zopefoundation/zope.testbrowser',
license='ZPL 2.1',
project_urls={
@@ -47,6 +47,7 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Testing',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.3/src/zope/testbrowser/browser.py
new/zope.testbrowser-5.4.0/src/zope/testbrowser/browser.py
--- old/zope.testbrowser-5.3.3/src/zope/testbrowser/browser.py 2019-07-02
13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/src/zope/testbrowser/browser.py 2019-11-01
10:44:52.000000000 +0100
@@ -14,7 +14,6 @@
"""Webtest-based Functional Doctest interfaces
"""
-import sys
import re
import time
import io
@@ -192,10 +191,10 @@
if self._response is None:
raise BrowserStateError("no URL has yet been .open()ed")
- req = self._response.request
- with self._preparedRequest(self.url):
- resp = self.testapp.request(req)
- self._setResponse(resp)
+ def make_request(args):
+ return self.testapp.request(self._response.request)
+
+ self._processRequest(self.url, make_request)
def goBack(self, count=1):
"""See zope.testbrowser.interfaces.IBrowser"""
@@ -1408,11 +1407,11 @@
end_time = 0
def _getTime(self):
- if sys.platform.startswith('win'):
- # Windows' time.clock gives us high-resolution wall-time
- return time.clock()
+ if hasattr(time, 'perf_counter'):
+ # Python 3
+ return time.perf_counter()
else:
- # everyone else uses time.time
+ # Python 2
return time.time()
def start(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.3/src/zope/testbrowser/fixed-bugs.txt
new/zope.testbrowser-5.4.0/src/zope/testbrowser/fixed-bugs.txt
--- old/zope.testbrowser-5.3.3/src/zope/testbrowser/fixed-bugs.txt
2019-07-02 13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/src/zope/testbrowser/fixed-bugs.txt
2019-11-01 10:44:52.000000000 +0100
@@ -111,7 +111,7 @@
This is how it works with a simple open():
- >>> browser.handleErrors=False
+ >>> browser.handleErrors = False
>>> browser.open('http://localhost/set_status.html')
>>> print(browser.contents)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.3/src/zope/testbrowser/tests/test_browser.py
new/zope.testbrowser-5.4.0/src/zope/testbrowser/tests/test_browser.py
--- old/zope.testbrowser-5.3.3/src/zope/testbrowser/tests/test_browser.py
2019-07-02 13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/src/zope/testbrowser/tests/test_browser.py
2019-11-01 10:44:52.000000000 +0100
@@ -240,10 +240,89 @@
"""
+def test_redirect_after_reload():
+ r"""
+ When browser is redirected after a page reload, reload() will follow it
+
+ >>> app = YetAnotherTestApp()
+ >>> browser = Browser(wsgi_app=app)
+ >>> html = (b'''\
+ ... <html><body>
+ ... Please wait, generating the thing
+ ... </body></html>
+ ... ''')
+ >>> content_type = ('Content-Type', 'text/html; charset=UTF-8')
+ >>> app.add_response(html, headers=[content_type])
+
+ >>> redirect = ('Location', 'http://localhost/the_thing')
+ >>> app.add_response(b"Moved", headers=[redirect],
+ ... status=302, reason='Found')
+ >>> app.add_response(b"The Thing", headers=[content_type])
+
+ Start conversation
+
+ >>> browser.open("http://localhost/")
+
+ After reload, expect the browser to be redirected
+
+ >>> browser.reload()
+ >>> browser.url
+ 'http://localhost/the_thing'
+ >>> browser.contents
+ 'The Thing'
+
+ """
+
+
+def test_error_after_reload():
+ r"""
+ When browser is redirected after a page reload, reload() will check
+ for bad HTTP status codes
+
+ >>> app = YetAnotherTestApp()
+ >>> browser = Browser(wsgi_app=app)
+ >>> browser.handleErrors = False
+ >>> html = (b'''\
+ ... <html><body>
+ ... Please wait, generating the thing
+ ... </body></html>
+ ... ''')
+ >>> content_type = ('Content-Type', 'text/html; charset=UTF-8')
+ >>> app.add_response(html, headers=[content_type])
+
+ >>> app.add_response(b"These are not the droids you're looking for",
+ ... status=403, reason='Forbidden')
+
+ Start conversation
+
+ >>> browser.open("http://localhost/")
+
+ After reload, expect the error to be raised
+
+ XXX: I expected
+
+ ## >>> browser.reload()
+ ## Traceback (most recent call last):
+ ## ...
+ ## HTTPError: HTTP Error 403: Forbidden
+
+ which is what the tests in fixed-bugs.txt get, but what I actually get
+ instead is
+
+ >>> browser.reload()
+ Traceback (most recent call last):
+ ...
+ webtest.app.AppError: Bad response: 403 Forbidden
+ (not 200 OK or 3xx redirect for http://localhost/)
+ These are not the droids you're looking for
+
+ """
+
+
def test_reload_after_redirect():
"""
When browser is redirected after form submit, reload() will not resubmit
- oroginal form data.
+ original form data.
>>> app = YetAnotherTestApp()
>>> browser = Browser(wsgi_app=app)
@@ -1259,12 +1338,16 @@
def test_suite():
- suite = unittest.TestSuite()
- suite.addTests([
+ optionflags = (
+ doctest.NORMALIZE_WHITESPACE
+ | doctest.ELLIPSIS
+ | doctest.IGNORE_EXCEPTION_DETAIL
+ )
+ suite = unittest.TestSuite([
unittest.defaultTestLoader.loadTestsFromName(__name__),
doctest.DocTestSuite(
checker=zope.testbrowser.tests.helper.checker,
- optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
+ optionflags=optionflags),
])
return suite
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zope.testbrowser-5.3.3/src/zope.testbrowser.egg-info/PKG-INFO
new/zope.testbrowser-5.4.0/src/zope.testbrowser.egg-info/PKG-INFO
--- old/zope.testbrowser-5.3.3/src/zope.testbrowser.egg-info/PKG-INFO
2019-07-02 13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/src/zope.testbrowser.egg-info/PKG-INFO
2019-11-01 10:44:52.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: zope.testbrowser
-Version: 5.3.3
+Version: 5.4.0
Summary: Programmable browser for functional black-box tests
Home-page: https://github.com/zopefoundation/zope.testbrowser
Author: Zope Corporation and Contributors
@@ -33,6 +33,17 @@
CHANGES
=======
+ 5.4.0 (2019-11-01)
+ ------------------
+
+ - Fix a bug where browser.reload() would not follow redirects or raise
+ exceptions for bad HTTP statuses. See `issue 75
+ <https://zopefoundation/zope.testbrowser/issue/75>`_.
+
+ - Add Python 3.8 support. See `issue 80
+ <https://github.com/zopefoundation/zope.testbrowser/issue/80>`_.
+
+
5.3.3 (2019-07-02)
------------------
@@ -534,6 +545,7 @@
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 :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zope.testbrowser-5.3.3/tox.ini
new/zope.testbrowser-5.4.0/tox.ini
--- old/zope.testbrowser-5.3.3/tox.ini 2019-07-02 13:25:02.000000000 +0200
+++ new/zope.testbrowser-5.4.0/tox.ini 2019-11-01 10:44:52.000000000 +0100
@@ -4,6 +4,7 @@
py35,
py36,
py37,
+ py38,
pypy,
pypy3,
docs,
@@ -16,6 +17,28 @@
coverage
commands =
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
+setenv =
+ COVERAGE_FILE=.coverage.{envname}
+
+[testenv:coverage-report]
+basepython = python3.6
+deps = coverage
+skip_install = true
+commands =
+ coverage erase
+ coverage combine
+ coverage report -m
+setenv =
+ COVERAGE_FILE=.coverage
+parallel_show_output = true
+depends =
+ py27,
+ py35,
+ py36,
+ py37,
+ py38,
+ pypy,
+ pypy3,
[testenv:docs]
basepython =