[pypy-svn] r28110 - in pypy/dist/pypy/rpython: ootypesystem test
antocuni at codespeak.net
antocuni at codespeak.net
Fri Jun 2 16:48:52 CEST 2006
Author: antocuni
Date: Fri Jun 2 16:48:50 2006
New Revision: 28110
Modified:
pypy/dist/pypy/rpython/ootypesystem/rpbc.py
pypy/dist/pypy/rpython/test/test_rdict.py
pypy/dist/pypy/rpython/test/test_rstr.py
Log:
(antocuni, nikh)
Fixed a bug that prevented assertion to work. Don't longer skip some
tests that make use of 'assert'.
Modified: pypy/dist/pypy/rpython/ootypesystem/rpbc.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rpbc.py (original)
+++ pypy/dist/pypy/rpython/ootypesystem/rpbc.py Fri Jun 2 16:48:50 2006
@@ -59,9 +59,15 @@
for desc in self.s_pbc.descriptions:
if desc.find_source_for('__init__') is not None:
unbound = desc.s_get_value(desc.getuniqueclassdef(), '__init__')
- unbound, = unbound.descriptions
- bound = unbound.bind_self(desc.getuniqueclassdef())
- inits.append(bound)
+ if isinstance(unbound, annmodel.SomePBC):
+ unbound, = unbound.descriptions
+ bound = unbound.bind_self(desc.getuniqueclassdef())
+ inits.append(bound)
+ else:
+ assert isinstance(unbound, annmodel.SomeBuiltin)
+ # do nothing, because builtin __init__s (for
+ # example from exceptions such as Exception and
+ # AssertionError) do nothing.
if inits:
s_init = annmodel.SomePBC(inits)
Modified: pypy/dist/pypy/rpython/test/test_rdict.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rdict.py (original)
+++ pypy/dist/pypy/rpython/test/test_rdict.py Fri Jun 2 16:48:50 2006
@@ -124,7 +124,6 @@
assert res == 42
def test_dict_itermethods(self):
- self._skip_oo('assert')
def func():
d = {}
d['hello'] = 6
Modified: pypy/dist/pypy/rpython/test/test_rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rstr.py (original)
+++ pypy/dist/pypy/rpython/test/test_rstr.py Fri Jun 2 16:48:50 2006
@@ -239,7 +239,6 @@
assert res == fn(i, j)
def test_find_with_start(self):
- self._skip_oo('assert')
def fn(i):
assert i >= 0
return 'ababcabc'.find('abc', i)
@@ -248,7 +247,6 @@
assert res == fn(i)
def test_find_with_start_end(self):
- self._skip_oo('assert')
def fn(i, j):
assert i >= 0
assert j >= 0
More information about the Pypy-commit
mailing list