[Pkg-zope-developers] Bug#351980: zope.testbrowser related failure
in zope3 self tests
Brian Sutherland
jinty at web.de
Wed Feb 8 21:53:21 UTC 2006
Package: zope3
Version: 3.2.0-2
Severity: normal
Tags: patch
Using a testrunner script (included later) against an installed zope3
package I found a number of failures due to the mechanize module not
finding the right pullparser module (ours) and using the one included in
zope3.
This can be fixed by applying the patch used to fix the issue upstream:
http://mail.zope.org/pipermail/zope3-checkins/2006-January/026957.html
(except for adding the ClientForm.py and pullparser.py modules)
The failures look like:
Failure in test /usr/lib/python2.4/site-packages/zope/app/apidoc/browser/README.txt
Failed doctest test for README.txt
File "/usr/lib/python2.4/site-packages/zope/app/apidoc/browser/README.txt", line 0
----------------------------------------------------------------------
File "/usr/lib/python2.4/site-packages/zope/app/apidoc/browser/README.txt", line 8, in README.txt
Failed example:
browser = Browser()
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/zope/testing/doctest.py", line 1256, in __run
compileflags, 1) in test.globs
File "<doctest README.txt[1]>", line 1, in ?
browser = Browser()
File "/usr/lib/python2.4/site-packages/zope/testbrowser/testing.py", line 146, in __init__
mech_browser = PublisherMechanizeBrowser()
File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 238, in __init__
links_factory = LinksFactory()
File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 73, in __init__
assert pullparser.__version__[:3] >= (0, 0, 7), \
AssertionError: pullparser 0.0.7 or newer is required
The testrunner script used is:
#!/usr/bin/env python2.4
##############################################################################
#
# Copyright (c) 2004 Zope Corporation 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.
#
##############################################################################
"""Test script for Debian Zope3 packages.
This test script will run the self tests of an installed zope3 debian package.
Simply do:
pythonx.y test.py
"""
import logging, os, sys, warnings
here = os.path.abspath(os.path.dirname(sys.argv[0]))
# Remove this directory from path:
sys.path[:] = [p for p in sys.path if os.path.abspath(p) != here]
from zope.testing import testrunner
# Change the directory so that zope.app.functional
# will be able to find the ftesting zcml
os.chdir('/usr/lib/zope3/zopeskel')
# run both functional and unit tests
defaults = ['--tests-pattern', '^f?tests$']
# add the debian pythonpath
pyver = '.'.join([str(i) for i in sys.version_info[:2]])
defaults += ['--path', '/usr/lib/python%s/site-packages' % pyver]
# regex of modules to be tested, maybe this is not a complete list
defaults += ['-m',
'^('
'zope'
'|'
'RestrictedPython'
'|'
'transaction'
'|'
'zodbcode'
')']
# Don't bother trying to remove old bytecode, as we probably can not
defaults += ['-k']
# Get rid of twisted.conch.ssh warning
warnings.filterwarnings(
'ignore', 'PyCrypto', RuntimeWarning, 'twisted[.]conch[.]ssh')
result = testrunner.run(defaults)
# Avoid spurious error during exit. Some thing is trying to log
# something after the files used by the logger have been closed.
logging.disable(999999999)
sys.exit(result)
-- System Information:
Debian Release: testing/unstable
APT prefers stable
APT policy: (990, 'stable'), (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-9-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Versions of packages zope3 depends on:
ii libc6 2.3.5-12 GNU C Library: Shared libraries an
ii lsb-base 3.0-12 Linux Standard Base 3.0 init scrip
ii python-docutils 0.3.9-0.1 Utilities for the documentation of
ii python2.4 2.4.2-1 An interactive high-level object-o
ii python2.4-clientcookie 1.1.1-1 Python 2.4.x module for automating
ii python2.4-mechanize 0.0.11a-2 stateful programmatic web browsing
ii python2.4-tz 2005r-1 Python version of the Olson timezo
ii zope-common 0.5.9 common settings and scripts for zo
zope3 recommends no packages.
-- no debconf information
More information about the Pkg-zope-developers
mailing list