← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jml/launchpad/testtools-0.9.6 into lp:launchpad/devel

 

Jonathan Lange has proposed merging lp:~jml/launchpad/testtools-0.9.6 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


This branch upgrades the version of testtools that we are using to an actual released version, 0.9.6.

The new version of testtools has a very similar version of assertEqual, so we no longer need to define our own.

-- 
https://code.launchpad.net/~jml/launchpad/testtools-0.9.6/+merge/33556
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jml/launchpad/testtools-0.9.6 into lp:launchpad/devel.
=== modified file 'lib/lp/testing/__init__.py'
--- lib/lp/testing/__init__.py	2010-08-20 20:31:18 +0000
+++ lib/lp/testing/__init__.py	2010-08-24 17:11:44 +0000
@@ -50,7 +50,6 @@
     ]
 
 from contextlib import contextmanager
-from cStringIO import StringIO
 from datetime import (
     datetime,
     timedelta,
@@ -86,6 +85,8 @@
     )
 import subunit
 import testtools
+from testtools.content import Content
+from testtools.content_type import UTF8_TEXT
 import transaction
 # zope.exception demands more of frame objects than twisted.python.failure
 # provides in its fake frames.  This is enough to make it work with them
@@ -392,15 +393,6 @@
                 "Expected %s to be %s, but it was %s."
                 % (attribute_name, date, getattr(sql_object, attribute_name)))
 
-    def assertEqual(self, a, b, message=''):
-        """Assert that 'a' equals 'b'."""
-        if a == b:
-            return
-        if message:
-            message += '\n'
-        self.fail("%snot equal:\na = %s\nb = %s\n"
-                  % (message, pformat(a), pformat(b)))
-
     def assertIsInstance(self, instance, assert_class):
         """Assert that an instance is an instance of assert_class.
 
@@ -451,11 +443,8 @@
 
     def attachOopses(self):
         if len(self.oopses) > 0:
-            content_type = testtools.content_type.ContentType(
-                "text", "plain", {"charset": "utf8"})
             for (i, oops) in enumerate(self.oopses):
-                content = testtools.content.Content(
-                    content_type, oops.get_chunks)
+                content = Content(UTF8_TEXT, oops.get_chunks)
                 self.addDetail("oops-%d" % i, content)
 
     def setUp(self):

=== modified file 'lib/lp/testing/matchers.py'
--- lib/lp/testing/matchers.py	2010-08-20 20:31:18 +0000
+++ lib/lp/testing/matchers.py	2010-08-24 17:11:44 +0000
@@ -15,7 +15,7 @@
     ]
 
 from testtools.content import Content
-from testtools.content_type import ContentType
+from testtools.content_type import UTF8_TEXT
 from testtools.matchers import (
     Matcher,
     Mismatch,
@@ -137,8 +137,7 @@
         result = []
         for query in self.query_collector.queries:
             result.append(unicode(query).encode('utf8'))
-        return {'queries': Content(ContentType('text', 'plain',
-            {'charset': 'utf8'}), lambda:['\n'.join(result)])}
+        return {'queries': Content(UTF8_TEXT, lambda:['\n'.join(result)])}
  
 
 class IsNotProxied(Mismatch):

=== modified file 'versions.cfg'
--- versions.cfg	2010-08-23 14:40:19 +0000
+++ versions.cfg	2010-08-24 17:11:44 +0000
@@ -65,8 +65,7 @@
 SimpleTal = 4.1
 sourcecodegen = 0.6.9
 storm = 0.17
-# Has the LessThan matcher.
-testtools = 0.9.6dev91
+testtools = 0.9.6
 transaction = 1.0.0
 Twisted = 10.1.0
 uuid = 1.30


Follow ups