[Zope-dev] Python 2.7 and the ZTK - three test failures

Hanno Schlichting hanno at hannosch.eu
Tue Jul 6 14:18:45 EDT 2010


Hi again.

On Mon, Jul 5, 2010 at 11:08 PM, Hanno Schlichting <hanno at hannosch.eu> wrote:
> with Python 2.7 final being released, I ran the ZTK tests against it.
>
> zope.exceptions, zope.formlib and zope.proxy all have one test output
> related failure.

I fixed all of those and released new versions. bin/test-ztk should
now pass under Python 2.7.

> RestrictedPython will need a security review.

I hear David Glick has started to look into this. Applause!

Running bin/test-zopeapp still gives failures in two packages:
zope.app.publisher and zope.app.wsgi.

I'm not familiar enough with that code to fix any of those.

Hanno

Full test output:

Running test-zopeapp-zope.app.publisher
test-zopeapp-zope.app.publisher failed with:
Running zope.app.publisher.testing.AppPublisherLayer tests:
  Set up zope.app.publisher.testing.AppPublisherLayer in 1.360 seconds.

Failure in test
/opt/eggs/zope.app.publisher-3.10.1-py2.7.egg/zope/app/publisher/xmlrpc/tests/../README.txt
Traceback (most recent call last):
  File "/opt/python/parts/opt/lib/python2.7/unittest/case.py", line 318, in run
    testMethod()
  File "/opt/python/parts/opt/lib/python2.7/doctest.py", line 2153, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for README.txt
  File "/opt/eggs/zope.app.publisher-3.10.1-py2.7.egg/zope/app/publisher/xmlrpc/tests/../README.txt",
line 0

----------------------------------------------------------------------
File "/opt/eggs/zope.app.publisher-3.10.1-py2.7.egg/zope/app/publisher/xmlrpc/tests/../README.txt",
line 65, in README.txt
Failed example:
    proxy.contents()
Exception raised:
    Traceback (most recent call last):
      File "/opt/python/parts/opt/lib/python2.7/doctest.py", line 1248, in __run
        compileflags, 1) in test.globs
      File "<doctest README.txt[7]>", line 1, in <module>
        proxy.contents()
      File "/opt/python/parts/opt/lib/python2.7/xmlrpclib.py", line
1224, in __call__
        return self.__send(self.__name, args)
      File "/opt/python/parts/opt/lib/python2.7/xmlrpclib.py", line
1570, in __request
        verbose=self.__verbose
      File "/opt/eggs/zope.app.testing-3.7.5-py2.7.egg/zope/app/testing/xmlrpc.py",
line 62, in request
        return self._parse_response(
    AttributeError: ZopeTestTransport instance has no attribute
'_parse_response'

[... snip lots more failures with the same problem ...]

  Ran 1 tests with 1 failures and 0 errors in 0.163 seconds.
Running zope.testing.testrunner.layer.UnitTests tests:
  Tear down zope.app.publisher.testing.AppPublisherLayer in 0.001 seconds.
  Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
  Ran 11 tests with 0 failures and 0 errors in 0.089 seconds.
Tearing down left over layers:
  Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.
Total: 12 tests, 1 failures, 0 errors in 1.791 seconds.



Running test-zopeapp-zope.app.wsgi
test-zopeapp-zope.app.wsgi failed with:
Running zope.app.wsgi.BrowserLayer tests:
  Set up zope.app.wsgi.BrowserLayer in 0.222 seconds.

Failure in test test_file_returns (zope.app.wsgi.tests)
Failed doctest test for zope.app.wsgi.tests.test_file_returns
  File "/opt/eggs/zope.app.wsgi-3.9.2-py2.7.egg/zope/app/wsgi/tests.py",
line 61, in test_file_returns

----------------------------------------------------------------------
File "/opt/eggs/zope.app.wsgi-3.9.2-py2.7.egg/zope/app/wsgi/tests.py",
line 77, in zope.app.wsgi.tests.test_file_returns
Failed example:
    browser.open('http://localhost/@@test-file-view.html')
Exception raised:
    Traceback (most recent call last):
      File "/opt/eggs/zope.testing-3.9.4-py2.7.egg/zope/testing/doctest/__init__.py",
line 1355, in __run
        compileflags, 1) in test.globs
      File "<doctest zope.app.wsgi.tests.test_file_returns[line 16,
example 6]>", line 1, in <module>
        browser.open('http://localhost/@@test-file-view.html')
      File "/opt/eggs/zope.testbrowser-3.9.0-py2.7.egg/zope/testbrowser/browser.py",
line 237, in open
        self.mech_browser.open(url, data)
      File "/opt/eggs/mechanize-0.2.1-py2.7.egg/mechanize/_mechanize.py",
line 204, in open
        return self._mech_open(url, data, timeout=timeout)
      File "/opt/eggs/mechanize-0.2.1-py2.7.egg/mechanize/_mechanize.py",
line 231, in _mech_open
        response = UserAgentBase.open(self, request, data)
      File "/opt/eggs/mechanize-0.2.1-py2.7.egg/mechanize/_opener.py",
line 193, in open
        response = urlopen(self, req, data)
      File "/opt/eggs/mechanize-0.2.1-py2.7.egg/mechanize/_urllib2_fork.py",
line 344, in _open
        '_open', req)
      File "/opt/eggs/mechanize-0.2.1-py2.7.egg/mechanize/_urllib2_fork.py",
line 332, in _call_chain
        result = func(*args)
      File "/opt/eggs/wsgi_intercept-0.4-py2.7.egg/wsgi_intercept/urllib2_intercept/wsgi_urllib2.py",
line 34, in http_open
        return self.do_open(WSGI_HTTPConnection, req)
      File "/opt/python/parts/opt/lib/python2.7/urllib2.py", line
1142, in do_open
        h.request(req.get_method(), req.get_selector(), req.data, headers)
      File "/opt/python/parts/opt/lib/python2.7/httplib.py", line 946,
in request
        self._send_request(method, url, body, headers)
      File "/opt/python/parts/opt/lib/python2.7/httplib.py", line 986,
in _send_request
        self.putheader(hdr, value)
      File "/opt/python/parts/opt/lib/python2.7/httplib.py", line 924,
in putheader
        str = '%s: %s' % (header, '\r\n\t'.join(values))
    TypeError: sequence item 0: expected string, bool found
----------------------------------------------------------------------
File "/opt/eggs/zope.app.wsgi-3.9.2-py2.7.egg/zope/app/wsgi/tests.py",
line 78, in zope.app.wsgi.tests.test_file_returns
Failed example:
    browser.headers['content-type']
Exception raised:
    Traceback (most recent call last):
      File "/opt/eggs/zope.testing-3.9.4-py2.7.egg/zope/testing/doctest/__init__.py",
line 1355, in __run
        compileflags, 1) in test.globs
      File "<doctest zope.app.wsgi.tests.test_file_returns[line 17,
example 7]>", line 1, in <module>
        browser.headers['content-type']
      File "/opt/eggs/zope.testbrowser-3.9.0-py2.7.egg/zope/testbrowser/browser.py",
line 208, in headers
        return self.mech_browser.response().info()
    AttributeError: 'NoneType' object has no attribute 'info'
----------------------------------------------------------------------
File "/opt/eggs/zope.app.wsgi-3.9.2-py2.7.egg/zope/app/wsgi/tests.py",
line 81, in zope.app.wsgi.tests.test_file_returns
Failed example:
    browser.headers['content-length']
Exception raised:
    Traceback (most recent call last):
      File "/opt/eggs/zope.testing-3.9.4-py2.7.egg/zope/testing/doctest/__init__.py",
line 1355, in __run
        compileflags, 1) in test.globs
      File "<doctest zope.app.wsgi.tests.test_file_returns[line 20,
example 8]>", line 1, in <module>
        browser.headers['content-length']
      File "/opt/eggs/zope.testbrowser-3.9.0-py2.7.egg/zope/testbrowser/browser.py",
line 208, in headers
        return self.mech_browser.response().info()
    AttributeError: 'NoneType' object has no attribute 'info'
----------------------------------------------------------------------
File "/opt/eggs/zope.app.wsgi-3.9.2-py2.7.egg/zope/app/wsgi/tests.py",
line 84, in zope.app.wsgi.tests.test_file_returns
Failed example:
    print browser.contents
Expected:
    Hello
    World!
    <BLANKLINE>
Got:
    None

  Ran 2 tests with 1 failures and 0 errors in 0.027 seconds.
Running zope.app.wsgi.ZCMLFileLayer tests:
  Tear down zope.app.wsgi.BrowserLayer in 0.000 seconds.
  Set up zope.app.wsgi.ZCMLFileLayer in 0.091 seconds.
  Ran 19 tests with 0 failures and 0 errors in 0.288 seconds.
Tearing down left over layers:
  Tear down zope.app.wsgi.ZCMLFileLayer in 0.000 seconds.
Total: 21 tests, 1 failures, 0 errors in 0.753 seconds.


More information about the Zope-Dev mailing list