[New-bugs-announce] [issue2153] unittest.py modernization

Virgil Dupras report at bugs.python.org
Thu Feb 21 14:18:14 CET 2008

New submission from Virgil Dupras:

What prompted me to do these changes is that "Backward compatibility" 
section for 2.1 and earlier. How long are we going to keep this? According 
to svn, no commit has been made on the 2.1 branch since 2003. Is it safe 
to assume no unittest change is ever going to be backported to 2.1?

Then, while I was in it, I made other changes:

 - dict.has_key(key) --> key in dict
 - raise Exception, args --> raise Exception(args)
 - try..except KeyboardInterrupt: raise except: do_stuff() --> try..except 
Exception: do_stuff()
 - __metaclass__ = type --> all classes are now object subclasses

I'm not sure about the last one. Are those 2 equivalent? Is there a reason 
to keep is as "__metaclass__ = type"?

regrtest passed for me.

components: Tests
files: unittest_modern.diff
messages: 62622
nosy: vdupras
severity: minor
status: open
title: unittest.py modernization
type: feature request
versions: Python 2.6
Added file: http://bugs.python.org/file9479/unittest_modern.diff

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list