[svn r38460] removing a very-likely-obsolete test
and otherwise fixing files and tests to do py.test.skip()s only during setup. --HG-- branch : trunk
This commit is contained in:
parent
e068a463a1
commit
22d98ac3a1
|
@ -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
|
||||
|
|
|
@ -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)'
|
|
@ -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',),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue