[Python-modules-team] Bug#689498: epsilon: tests fail with Twisted 2.12.0
Colin Watson
cjwatson at ubuntu.com
Wed Oct 3 10:15:27 UTC 2012
Package: epsilon
Version: 0.6.0-3
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch quantal
When built with Twisted 2.12.0, epsilon fails its tests as follows:
[ERROR]
Traceback (most recent call last):
File "/«PKGBUILDDIR»/debian/python-epsilon/usr/lib/python2.7/site-packages/epsilon/test/test_sslverify.py", line 206, in afterLost
log.flushErrors(SSL.Error)
exceptions.AttributeError: 'module' object has no attribute 'flushErrors'
epsilon.test.test_sslverify.OpenSSLOptions.testFailedCertificateVerification
===============================================================================
[ERROR]
Traceback (most recent call last):
File "/«PKGBUILDDIR»/debian/python-epsilon/usr/lib/python2.7/site-packages/epsilon/test/test_sslverify.py", line 184, in afterLost
log.flushErrors(SSL.Error)
exceptions.AttributeError: 'module' object has no attribute 'flushErrors'
epsilon.test.test_sslverify.OpenSSLOptions.testRefusedAnonymousClientConnection
twisted.python.log.flushErrors has been deprecated since Twisted 2.5.0
(http://twistedmatrix.com/trac/changeset/18352), which introduced the
replacement twisted.trial.unittest.TestCase.flushLoggedErrors. Twisted
12.2.0 removed this old deprecated method
(http://twistedmatrix.com/trac/changeset/34813). The following patch
converts to the newer method.
* Stop using log.flushErrors, which was deprecated in Twisted 2.5.0 and
removed in Twisted 12.2.0. Use TestCase.flushLoggedErrors instead.
diff -u epsilon-0.6.0/debian/control epsilon-0.6.0/debian/control
--- epsilon-0.6.0/debian/control
+++ epsilon-0.6.0/debian/control
@@ -4,7 +4,7 @@
Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
Uploaders: Stefano Zacchiroli <zack at debian.org>, Tristan Seligmann <mithrandi at mithrandi.net>, Vincent Bernat <bernat at debian.org>
Build-Depends: debhelper (>= 5), cdbs (>= 0.4.43), python, python-support (>= 0.4), quilt
-Build-Depends-Indep: python-twisted-core, python-openssl, python-nevow, python-zopeinterface
+Build-Depends-Indep: python-twisted-core (>= 2.5.0), python-openssl, python-nevow, python-zopeinterface
Standards-Version: 3.8.4
Vcs-Svn: svn://svn.debian.org/python-modules/packages/epsilon/trunk/
Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/epsilon/trunk/
diff -u epsilon-0.6.0/debian/patches/series epsilon-0.6.0/debian/patches/series
--- epsilon-0.6.0/debian/patches/series
+++ epsilon-0.6.0/debian/patches/series
@@ -4,0 +5 @@
+twisted-2.5.diff
only in patch2:
unchanged:
--- epsilon-0.6.0.orig/debian/patches/twisted-2.5.diff
+++ epsilon-0.6.0/debian/patches/twisted-2.5.diff
@@ -0,0 +1,58 @@
+Index: b/epsilon/test/test_setuphelper.py
+===================================================================
+--- a/epsilon/test/test_setuphelper.py
++++ b/epsilon/test/test_setuphelper.py
+@@ -2,7 +2,6 @@
+ import sys
+
+ from twisted.trial import unittest
+-from twisted.python import log
+ from twisted.python.reflect import namedAny
+ from epsilon.setuphelper import _regeneratePluginCache
+
+@@ -35,11 +34,10 @@
+ for mod in self.removedModules:
+ self.failIf(mod.__name__ in sys.modules, 'Started with %r loaded: %r' % (mod.__name__, sys.path))
+ _regeneratePluginCache(['axiom', 'xmantissa'])
+- log.flushErrors(ImportError) # This is necessary since there are Axiom
+- # plugins that depend on Mantissa, so when
+- # Axiom is installed, Mantissa-dependent
+- # powerups are, but Mantissa isn't some
+- # harmless tracebacks are printed.
++ # This is necessary since there are Axiom plugins that depend on
++ # Mantissa, so when Axiom is installed, Mantissa-dependent powerups
++ # are, but Mantissa isn't and some harmless tracebacks are printed.
++ self.flushLoggedErrors(ImportError)
+ for mod in self.removedModules:
+ self.failIf(mod.__name__ in sys.modules, 'Loaded %r: %r' % (mod.__name__, sys.path))
+
+Index: b/epsilon/test/test_sslverify.py
+===================================================================
+--- a/epsilon/test/test_sslverify.py
++++ b/epsilon/test/test_sslverify.py
+@@ -8,7 +8,6 @@
+
+ from twisted.trial import unittest, util
+ from twisted.internet import protocol, defer, reactor
+-from twisted.python import log
+
+
+ counter = itertools.count().next
+@@ -181,7 +180,7 @@
+ # errors. Twisted 2.1 will do the wrong thing. We're flushing
+ # errors until the buildbot is updated to a reasonable facsimilie
+ # of 2.2.
+- log.flushErrors(SSL.Error)
++ self.flushLoggedErrors(SSL.Error)
+
+ return d.addCallback(afterLost)
+
+@@ -203,7 +202,7 @@
+ # errors. Twisted 2.1 will do the wrong thing. We're flushing
+ # errors until the buildbot is updated to a reasonable facsimilie
+ # of 2.2.
+- log.flushErrors(SSL.Error)
++ self.flushLoggedErrors(SSL.Error)
+
+ return d.addCallback(afterLost)
+
Thanks,
--
Colin Watson [cjwatson at ubuntu.com]
More information about the Python-modules-team
mailing list