[pypy-svn] r61429 - pypy/trunk/pypy/module/_lsprof/test
fijal at codespeak.net
fijal at codespeak.net
Wed Jan 28 18:31:06 CET 2009
Author: fijal
Date: Wed Jan 28 18:31:03 2009
New Revision: 61429
Modified:
pypy/trunk/pypy/module/_lsprof/test/test_cprofile.py
Log:
a magic trick how this test can take less
Modified: pypy/trunk/pypy/module/_lsprof/test/test_cprofile.py
==============================================================================
--- pypy/trunk/pypy/module/_lsprof/test/test_cprofile.py (original)
+++ pypy/trunk/pypy/module/_lsprof/test/test_cprofile.py Wed Jan 28 18:31:03 2009
@@ -12,6 +12,16 @@
nprim = 106
optional_line = ''
+def match(pattern, string):
+ import re
+ if not re.match(pattern, string):
+ print method, 'differs:'
+ print 'Difference is here:'
+ print ' GOT:', pattern.rstrip('\n')
+ print 'EXPECTED:', string.rstrip('\n')
+ return False
+ return True
+
class AppTestCProfile(object):
def setup_class(cls):
@@ -24,6 +34,7 @@
else:
output = PyPyOutput.__dict__
cls.w_output = space.wrap(output)
+ cls.w_match = space.wrap(match)
def test_direct(self):
import _lsprof
@@ -142,11 +153,7 @@
pattern = pattern.replace('(', '\\(')
pattern = pattern.replace(')', '\\)')
pattern = pattern.replace('?', '\\?')
- if not re.match(pattern, string):
- print method, 'differs:'
- print 'Difference is here:'
- print ' GOT:', pattern.rstrip('\n')
- print 'EXPECTED:', string.rstrip('\n')
+ if not self.match(pattern, string):
assert False
assert len(expected) == len(lines)
finally:
More information about the Pypy-commit
mailing list