[Python-Dev] Proposed unittest changes (original) (raw)

Jonathan Lange jml at mumak.net
Fri Apr 18 00:28:17 CEST 2008


On Fri, Apr 18, 2008 at 12:54 AM, Guido van Rossum <guido at python.org> wrote:

I'm worried that a mass renaming would do anything but inconvenience users during the already stressful 2->3 transition.

I'm more in favor of the original proposal of reducing the redundancy post-3.0. If you're looking for useful features, Google has a set of extensions to unittest.py that I find useful: - module-level setUp and tearDown - routines for comparing large lists and strings that produce useful output indicating exactly where the inputs differ. - assertLess etc. - assertSameElements (sort of like assert(set(x) == set(y))

Hi,

Some things that Bazaar, Twisted and Launchpad have found helpful:

e.g

def make_temp_dir(self): dir = tempfile.mkdtemp() self.addCleanup(shutil.rmtree, dir) return dir

Luckily, I have patches (with tests!) for these that I will be filing on the tracker as soon as I get the opportunity.

jml



More information about the Python-Dev mailing list