diff --git a/py/apigen/source/server.py b/py/apigen/source/server.py index 0417d44d1..79c19354a 100644 --- a/py/apigen/source/server.py +++ b/py/apigen/source/server.py @@ -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 diff --git a/py/apigen/tracer/testing/test_magic.py b/py/apigen/tracer/testing/test_magic.py deleted file mode 100644 index 234d1625d..000000000 --- a/py/apigen/tracer/testing/test_magic.py +++ /dev/null @@ -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)' diff --git a/py/misc/testing/test_initpkg.py b/py/misc/testing/test_initpkg.py index d68586634..33f1d4d08 100644 --- a/py/misc/testing/test_initpkg.py +++ b/py/misc/testing/test_initpkg.py @@ -52,6 +52,8 @@ def test_importall(): 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',), diff --git a/py/test/rsession/testing/test_web.py b/py/test/rsession/testing/test_web.py index 661d4f6bf..b76d5e873 100644 --- a/py/test/rsession/testing/test_web.py +++ b/py/test/rsession/testing/test_web.py @@ -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 diff --git a/py/test/rsession/testing/test_webjs.py b/py/test/rsession/testing/test_webjs.py index 2f77171cf..fb097a226 100644 --- a/py/test/rsession/testing/test_webjs.py +++ b/py/test/rsession/testing/test_webjs.py @@ -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') +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 -here = py.magic.autopath().dirpath() + 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 diff --git a/py/test/testing/test_remote.py b/py/test/testing/test_remote.py index ea8fe2b97..0438c015a 100644 --- a/py/test/testing/test_remote.py +++ b/py/test/testing/test_remote.py @@ -38,7 +38,7 @@ class TestRemote: 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 @@ class TestRemote: 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