On Fri, Apr 18, 2008 at 12:54 AM, Guido van Rossum <[EMAIL PROTECTED]> 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:
- assertRaises returning the exception object that it catches. This
allows for easy testing of exception strings.
- Assertion methods for 'in', 'is' and 'isinstance' and their negations.
- TestCase.addCleanup. This method takes a function, args and kwargs
and pushes them to a stack of cleanups. Before tearDown is run, each
of these cleanups is popped off the stack and then run. This makes it
easier to acquire certain resources in tests:
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
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com