[pypy-svn] r12582 - pypy/dist/pypy/translator/test

pedronis at codespeak.net pedronis at codespeak.net
Thu May 19 22:26:44 CEST 2005


Author: pedronis
Date: Thu May 19 22:26:44 2005
New Revision: 12582

Modified:
   pypy/dist/pypy/translator/test/test_annrpython.py
Log:
test for sys attrs access



Modified: pypy/dist/pypy/translator/test/test_annrpython.py
==============================================================================
--- pypy/dist/pypy/translator/test/test_annrpython.py	(original)
+++ pypy/dist/pypy/translator/test/test_annrpython.py	Thu May 19 22:26:44 2005
@@ -1025,6 +1025,20 @@
         assert a.binding(et) == t
         assert isinstance(a.binding(ev), annmodel.SomeInstance) and a.binding(ev).classdef.cls == Exception
 
+    def test_sys_attrs(self):
+        import sys
+        def f():
+            return sys.argv[0]
+        a = self.RPythonAnnotator()
+        try:
+            oldvalue = sys.argv
+            sys.argv = []
+            s = a.build_types(f, [])
+        finally:
+            sys.argv = oldvalue
+        assert s is not None
+            
+
 
 def g(n):
     return [0,1,2,n]



More information about the Pypy-commit mailing list