Author: Manuel Jacob
Branch: remove-tuple-smm
Changeset: r64427:4b09b2a9ef69
Date: 2013-05-22 10:38 +0200
http://bitbucket.org/pypy/pypy/changeset/4b09b2a9ef69/
Log: Rewrite test_hash_agains_normal_tuple() to use one object space.
diff --git a/pypy/objspace/std/test/test_smalltupleobject.py
b/pypy/objspace/std/test/test_smalltupleobject.py
--- a/pypy/objspace/std/test/test_smalltupleobject.py
+++ b/pypy/objspace/std/test/test_smalltupleobject.py
@@ -67,14 +67,11 @@
assert isinstance(w_tuple, W_SmallTupleObject2)
def test_hash_agains_normal_tuple(self):
- normalspace = gettestobjspace(**{"objspace.std.withsmalltuple": False})
- w_tuple = normalspace.newtuple([self.space.wrap(1),
self.space.wrap(2)])
+ w_tuple = W_TupleObject([self.space.wrap(1), self.space.wrap(2)])
+ w_smalltuple = self.space.newtuple([self.space.wrap(1),
+ self.space.wrap(2)])
+ assert isinstance(w_smalltuple, W_SmallTupleObject2)
- smallspace = gettestobjspace(**{"objspace.std.withsmalltuple": True})
- w_smalltuple = smallspace.newtuple([self.space.wrap(1),
self.space.wrap(2)])
-
- assert isinstance(w_smalltuple, W_SmallTupleObject2)
- assert isinstance(w_tuple, W_TupleObject)
- assert not normalspace.is_true(normalspace.eq(w_tuple, w_smalltuple))
- assert smallspace.is_true(smallspace.eq(w_tuple, w_smalltuple))
- assert smallspace.is_true(smallspace.eq(normalspace.hash(w_tuple),
smallspace.hash(w_smalltuple)))
+ assert self.space.is_true(self.space.eq(w_tuple, w_smalltuple))
+ assert self.space.is_true(self.space.eq(self.space.hash(w_tuple),
+ self.space.hash(w_smalltuple)))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit