[py-svn] r38460 - in py/trunk/py: apigen/source apigen/tracer/testing misc/testing test/rsession/testing test/testing

hpk at codespeak.net hpk at codespeak.net
Sun Feb 11 14:46:48 CET 2007


Author: hpk
Date: Sun Feb 11 14:46:46 2007
New Revision: 38460

Removed:
   py/trunk/py/apigen/tracer/testing/test_magic.py
Modified:
   py/trunk/py/apigen/source/server.py
   py/trunk/py/misc/testing/test_initpkg.py
   py/trunk/py/test/rsession/testing/test_web.py
   py/trunk/py/test/rsession/testing/test_webjs.py
   py/trunk/py/test/testing/test_remote.py
Log:
removing a very-likely-obsolete test
and otherwise fixing files and tests 
to do py.test.skip()s only during setup. 



Modified: py/trunk/py/apigen/source/server.py
==============================================================================
--- py/trunk/py/apigen/source/server.py	(original)
+++ py/trunk/py/apigen/source/server.py	Sun Feb 11 14:46:46 2007
@@ -3,10 +3,7 @@
 """
 
 import py
-try:
-    from pypy.translator.js.examples import server
-except ImportError:
-    py.test.skip("PyPy not found")
+from pypy.translator.js.examples import server
 from py.__.apigen.source.browser import parse_path
 from py.__.apigen.source.html import create_html, create_dir_html, create_unknown_html
 from py.xml import html

Deleted: /py/trunk/py/apigen/tracer/testing/test_magic.py
==============================================================================
--- /py/trunk/py/apigen/tracer/testing/test_magic.py	Sun Feb 11 14:46:46 2007
+++ (empty file)
@@ -1,48 +0,0 @@
-
-""" test magic abilities of tracer
-"""
-
-import py
-py.test.skip("These features have been disabled")
-
-from py.__.apigen.tracer.magic import trace, get_storage, stack_copier, \
-    DocStorageKeeper
-from py.__.apigen.tracer.docstorage import DocStorage
-from py.__.apigen.tracer import model
-
-#def setup_function(f):
-#    DocStorageKeeper.set_storage(DocStorage().from_dict({}))
-
-def fun(a, b, c):
-    return "a"
-fun = trace()(fun)
-
-def test_magic():
-    fun(1, 2, 3)
-    
-    ds = get_storage()
-    assert 'fun' in ds.descs
-    assert len(ds.descs.keys()) == 2
-    desc = ds.descs['fun']
-    inputcells = desc.inputcells
-    assert isinstance(inputcells[0], model.SomeInt)
-    assert isinstance(inputcells[1], model.SomeInt)
-    assert isinstance(inputcells[2], model.SomeInt)
-    assert isinstance(desc.retval, model.SomeString)
-
-def g(x):
-    return f(x)
-
-def f(x):
-    return x + 3
-f = trace(keep_frames=True, frame_copier=stack_copier)(f)
-
-def test_fancy_copier():
-    g(1)
-    
-    ds = get_storage()
-    assert 'f' in ds.descs
-    desc = ds.descs['f']
-    stack = desc.call_sites.values()[0][0]
-    assert str(stack[0].statement) == '    return f(x)'
-    assert str(stack[1].statement) == '    g(1)'

Modified: py/trunk/py/misc/testing/test_initpkg.py
==============================================================================
--- py/trunk/py/misc/testing/test_initpkg.py	(original)
+++ py/trunk/py/misc/testing/test_initpkg.py	Sun Feb 11 14:46:46 2007
@@ -52,6 +52,8 @@
         base.join('test', 'testing', 'data'),
         base.join('apigen', 'tracer', 'testing', 'package'),
         base.join('test', 'testing', 'test'),
+        base.join('test', 'rsession', 'webjs.py'),
+        base.join('apigen', 'source', 'server.py'),
         base.join('magic', 'greenlet.py'), 
         base.join('path', 'gateway',),
         base.join('doc',),

Modified: py/trunk/py/test/rsession/testing/test_web.py
==============================================================================
--- py/trunk/py/test/rsession/testing/test_web.py	(original)
+++ py/trunk/py/test/rsession/testing/test_web.py	Sun Feb 11 14:46:46 2007
@@ -4,15 +4,15 @@
 
 import py
 
-try:
-    from pypy.translator.js.main import rpython2javascript
-    from pypy.translator.js import commproxy
-    
-    commproxy.USE_MOCHIKIT = False
-except ImportError:
-    py.test.skip("PyPy not found")
-
 def setup_module(mod):
+    try:
+        from pypy.translator.js.main import rpython2javascript
+        from pypy.translator.js import commproxy
+    except ImportError:
+        py.test.skip("PyPy not found")
+    mod.commproxy.USE_MOCHIKIT = False
+    mod.rpython2javascript = rpython2javascript
+    mod.commproxy = mod.commproxy
     from py.__.test.rsession.web import TestHandler as _TestHandler
     from py.__.test.rsession.web import MultiQueue
     mod._TestHandler = _TestHandler

Modified: py/trunk/py/test/rsession/testing/test_webjs.py
==============================================================================
--- py/trunk/py/test/rsession/testing/test_webjs.py	(original)
+++ py/trunk/py/test/rsession/testing/test_webjs.py	Sun Feb 11 14:46:46 2007
@@ -1,19 +1,26 @@
 import py
 
-try:
-    import pypy
-    from pypy.translator.js.modules import dom
-    from pypy.translator.js.tester import schedule_callbacks
-    dom.Window # check whether dom was properly imported or is just a 
-               # leftover in sys.modules
-except (ImportError, AttributeError):
-    py.test.skip('PyPy not found')
-
-from py.__.test.rsession import webjs
-from py.__.test.rsession.web import exported_methods
-here = py.magic.autopath().dirpath()
+def check(mod):
+    try:
+        import pypy
+        from pypy.translator.js.modules import dom
+        from pypy.translator.js.tester import schedule_callbacks
+        dom.Window # check whether dom was properly imported or is just a 
+                   # leftover in sys.modules
+    except (ImportError, AttributeError):
+        py.test.skip('PyPy not found')
+    mod.dom = dom
+    mod.schedule_callbacks = schedule_callbacks
+
+    from py.__.test.rsession import webjs
+    from py.__.test.rsession.web import exported_methods
+    mod.webjs = webjs
+    mod.exported_methods = exported_methods
+    mod.here = py.magic.autopath().dirpath()
 
 def setup_module(mod):
+    check(mod)
+
     # load HTML into window object
     html = here.join('../webdata/index.html').read()
     mod.html = html

Modified: py/trunk/py/test/testing/test_remote.py
==============================================================================
--- py/trunk/py/test/testing/test_remote.py	(original)
+++ py/trunk/py/test/testing/test_remote.py	Sun Feb 11 14:46:46 2007
@@ -38,7 +38,7 @@
         pool = py._thread.WorkerPool() 
         reply = pool.dispatch(session.main)
         while 1: 
-            s = out.get(timeout=1.0)
+            s = out.get(timeout=5.0)
             if s.find('1 failed') != -1: 
                 break 
             print s
@@ -46,7 +46,7 @@
             py.test.fail("did not see test_1 failure") 
         # XXX we would like to have a cleaner way to finish 
         try: 
-            reply.get(timeout=0.5) 
+            reply.get(timeout=5.0) 
         except IOError, e: 
             assert str(e).lower().find('timeout') != -1 
 



More information about the pytest-commit mailing list