[MERGE] Make the test suite run under Python 2.7a0

Andrew Bennetts andrew.bennetts at canonical.com
Fri Mar 27 06:19:41 GMT 2009


This patch makes the test suite run, although not pass, with Python's trunk
(a.k.a.  Python 2.7a0).  This is pretty low priority; Python 2.7 is still a
moving target, but this might make things a little easier for people interested
in testing and/or benchmarking the latest and greatest version of Python.

First, it seems Python has incompatibly changed sys.version_info so that it
isn't a tuple anymore, so it can't be passed to % of a str.  I think this is
perhaps a serious enough bug in 2.7a0 that it should be filed in Python's
tracker, but the workaround is simple.  It certainly seems weird to me that
Python has PySequenceStruct *and* collections.namedtuple to do essentially
the same thing with completely different implementations.

Second, unittest.TestCase no longer has _exc_info, which is fair enough, it
didn't really do anything useful beyond plain sys.exc_info() (trimming
uninteresting stack frames happens elsewhere).  It might be nice if Python
2.7 at least gave a DeprecationWarning, but as it's an undocumented private
method I guess all bets are off (even though it's one that people writing
their own TestCase.run would have wanted to use to maximise
compatibility...).

Finally, I even fix a genuine test failure due to an obvious test bug in
test_http.  Several other tests in test_http still fail though, due to
unexpected unicode objects, it appears that the config machinery is now
returning unicode passwords from AuthenicationConfig now for some reason.

-Andrew.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp2-7-4210.patch
Type: text/x-diff
Size: 6671 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090327/635bbbbf/attachment-0001.bin 


More information about the bazaar mailing list