[pypy-commit] pypy kill-someobject: Fix up annotation/test_model

alex_gaynor noreply at buildbot.pypy.org
Sun Oct 7 14:52:14 CEST 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: kill-someobject
Changeset: r57809:3b88de34eb5b
Date: 2012-10-07 05:51 -0700
http://bitbucket.org/pypy/pypy/changeset/3b88de34eb5b/

Log:	Fix up annotation/test_model

diff --git a/pypy/annotation/test/test_model.py b/pypy/annotation/test/test_model.py
--- a/pypy/annotation/test/test_model.py
+++ b/pypy/annotation/test/test_model.py
@@ -9,12 +9,13 @@
 listdef1 = ListDef(None, SomeTuple([SomeInteger(nonneg=True), SomeString()]))
 listdef2 = ListDef(None, SomeTuple([SomeInteger(nonneg=False), SomeString()]))
 
+s1 = SomeType()
 s2 = SomeInteger(nonneg=True)
 s3 = SomeInteger(nonneg=False)
 s4 = SomeList(listdef1)
 s5 = SomeList(listdef2)
 s6 = SomeImpossibleValue()
-slist = [s2,s3,s4,s6]  # not s5 -- unionof(s4,s5) modifies s4 and s5
+slist = [s1, s2, s3, s4, s6]  # not s5 -- unionof(s4,s5) modifies s4 and s5
 
 
 class C(object):
@@ -41,7 +42,7 @@
 
 def test_equality():
     assert s1 != s2 != s3 != s4 != s5 != s6
-    assert s1 == SomeObject()
+    assert s1 == SomeType()
     assert s2 == SomeInteger(nonneg=True)
     assert s3 == SomeInteger(nonneg=False)
     assert s4 == SomeList(listdef1)
@@ -50,19 +51,11 @@
 
 def test_contains():
     assert ([(s,t) for s in slist for t in slist if s.contains(t)] ==
-            [(s1,s1), (s1,s2), (s1,s3), (s1,s4), (s1,s6),
-                      (s2,s2),                   (s2,s6),
-                      (s3,s2), (s3,s3),          (s3,s6),
-                                        (s4,s4), (s4,s6),
-                                                 (s6,s6)])
-
-def test_union():
-    assert ([unionof(s,t) for s in slist for t in slist] ==
-            [s1, s1, s1, s1, s1,
-             s1, s2, s3, s1, s2,
-             s1, s3, s3, s1, s3,
-             s1, s1, s1, s4, s4,
-             s1, s2, s3, s4, s6])
+            [(s1, s1),                               (s1, s6),
+                       (s2, s2),                     (s2, s6),
+                       (s3, s2), (s3, s3),           (s3, s6),
+                                           (s4, s4), (s4, s6),
+                                                     (s6, s6)])
 
 def test_commonbase_simple():
     class A0: 
@@ -102,7 +95,7 @@
     listdef2 = ListDef(None, SomeInteger(nonneg=False))
     s2 = SomeList(listdef2)
     assert s1 != s2
-    assert s2.contains(s1)
+    assert not s2.contains(s1)
     assert s1 != s2
     assert not s1.contains(s2)
     assert s1 != s2


More information about the pypy-commit mailing list