[pypy-svn] r8026 - pypy/branch/src-pytest/pypy/tool
arigo at codespeak.net
arigo at codespeak.net
Sat Jan 1 22:22:14 CET 2005
Author: arigo
Date: Sat Jan 1 22:22:13 2005
New Revision: 8026
Modified:
pypy/branch/src-pytest/pypy/tool/utestconvert.py
Log:
self.assertRaises_w() -> self.raises_w()
This is the first PyPy-specific conversion done by utestconvert.py. It should
be removed for when utestconvert.py is to become a general unittest->pytest
converter.
Modified: pypy/branch/src-pytest/pypy/tool/utestconvert.py
==============================================================================
--- pypy/branch/src-pytest/pypy/tool/utestconvert.py (original)
+++ pypy/branch/src-pytest/pypy/tool/utestconvert.py Sat Jan 1 22:22:13 2005
@@ -23,6 +23,7 @@
d['failIfAlmostEqual'] = ('assert not round', ' ==', [2,3,4])
d['assertNotAlmostEqual'] = ('assert round', ' !=', [2,3,4])
d['failUnlessAlmostEquals'] = ('assert not round', ' !=', [2,3,4])
+d['assertRaises_w'] = ('self.raises_w', '', ['Any'])
# the list of synonyms
d['failUnlessRaises'] = d['assertRaises']
@@ -79,7 +80,7 @@
possible_args = d[old][2] # a list of the number of arguments the
# unittest function could possibly take.
- if new == 'raises': # just rename assertRaises & friends
+ if possible_args == ['Any']: # just rename assertRaises & friends
return re.sub('self.'+old, new, block)
message_pos = possible_args[-1]
More information about the Pypy-commit
mailing list