Author: Anton Gulenko <[email protected]>
Branch: rstrategies
Changeset: r1048:99d4a04ffa5a
Date: 2014-09-18 13:34 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/99d4a04ffa5a/

Log:    Added test, set recursion limit higher to make tests work in
        CPython.

diff --git a/spyvm/test/test_strategies.py b/spyvm/test/test_strategies.py
--- a/spyvm/test/test_strategies.py
+++ b/spyvm/test/test_strategies.py
@@ -43,6 +43,18 @@
         else:
             assert False, "Unexpected array of expected values."
 
+# ====== StrategyFactory
+
+def test_ordered_strategies():
+    strategies = space.strategy_factory.strategies
+    assert len(strategies) == 4
+    index_nil = strategies.index(storage.AllNilStorageShadow)
+    index_float = strategies.index(storage.FloatOrNilStorageShadow)
+    index_int = strategies.index(storage.SmallIntegerOrNilStorageShadow)
+    index_list = strategies.index(storage.ListStorageShadow)
+    assert index_nil < index_float < index_list
+    assert index_nil < index_int < index_list
+
 # ====== AllNil StorageShadow
 
 def test_EmptyArray():
diff --git a/spyvm/test/test_zin_squeak_4_5_image.py 
b/spyvm/test/test_zin_squeak_4_5_image.py
--- a/spyvm/test/test_zin_squeak_4_5_image.py
+++ b/spyvm/test/test_zin_squeak_4_5_image.py
@@ -1,10 +1,14 @@
-import operator
+import operator, sys
 from spyvm import model
 from .util import read_image, copy_to_module, cleanup_module, slow_test, 
very_slow_test
 
 # The tests are quick, but loading the big image takes time.
 pytestmark = slow_test
 
+# Otherwise the image does not load on some systems.
+# This is not required when using pypy.
+sys.setrecursionlimit(100000)
+
 def setup_module():
     space, interp, image, reader = read_image('Squeak4.5-12568.image')
     w = space.w
diff --git a/spyvm/test/util.py b/spyvm/test/util.py
--- a/spyvm/test/util.py
+++ b/spyvm/test/util.py
@@ -10,7 +10,7 @@
                         reason="Slow tests are being skipped because of 
-Q|--quick option.")
 
 very_slow_test = py.test.mark.skipif('not 
config.getvalue("execute-slow-tests")',
-                        reason="Very slow tests are being skipped. Add 
--slow|-S to execute all tests.")
+                        reason="Very slow tests are being skipped. Add 
-S|--slow to execute all tests.")
 
 # Most tests don't need a bootstrapped objspace. Those that do, indicate so 
explicitely.
 # This way, as many tests as possible use the real, not-bootstrapped ObjSpace.
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to