Regression Testing for Python 2.5
Yesterday, Python 2.5 was released. That means that it is time to find out how good the test coverage is on the various tools I care about. Within the past 24 hours, I made fixes to the Feed Validator, the Universal Feed Parser, and Venus. I also prepared this patch for Beautiful Soup — note: there still is one test that fails on 3.2 that I don’t understand, but that can wait for another day.
The change was typical of what I found. The code is meant to compare the number of children that have the same name against the constant 10. __cmp__
was a member function defined on the string and unicode classes, but that method was apparently removed in favor of defining __eq__
. For most usages, this change is transparent, but not this one. And I can’t change to simply use __eq__
as that method isn’t defined on strings in Python 2.4. So, I used list comprehensions instead. Sometimes it is a good thing when there are more than one way to do things.
I’m confident that the test coverage isn’t 100%, and in fact I am currently writing up more test cases for the Feed Parser; but even so, passing the tests that have been written to date, and in the process only finding minor issues does increase my confidence.
But that’s not the full story. The changes to sgmllib
in particular could have been considerably more painful had I not gotten involved before the release.