From pedronis at codespeak.net Sun Jul 1 14:18:04 2007 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Sun, 1 Jul 2007 14:18:04 +0200 (CEST) Subject: [py-svn] r44648 - py/trunk/py/test Message-ID: <20070701121804.C3BDC80C9@code0.codespeak.net> Author: pedronis Date: Sun Jul 1 14:18:02 2007 New Revision: 44648 Modified: py/trunk/py/test/collect.py Log: PyCollectorMixin is intented to override Collector behavior, if we want to use super it really needs to subclass from it to get mros to that effect. If the obscure semi-override was intentional (?) holler Modified: py/trunk/py/test/collect.py ============================================================================== --- py/trunk/py/test/collect.py (original) +++ py/trunk/py/test/collect.py Sun Jul 1 14:18:02 2007 @@ -289,7 +289,7 @@ name2items[name] = res return res -class PyCollectorMixin(object): +class PyCollectorMixin(Collector): def funcnamefilter(self, name): return name.startswith('test') def classnamefilter(self, name): From pedronis at codespeak.net Sun Jul 1 15:44:40 2007 From: pedronis at codespeak.net (pedronis at codespeak.net) Date: Sun, 1 Jul 2007 15:44:40 +0200 (CEST) Subject: [py-svn] r44655 - py/trunk/py/test Message-ID: <20070701134440.EE69080BE@code0.codespeak.net> Author: pedronis Date: Sun Jul 1 15:44:40 2007 New Revision: 44655 Modified: py/trunk/py/test/collect.py Log: be consistent in super usage Modified: py/trunk/py/test/collect.py ============================================================================== --- py/trunk/py/test/collect.py (original) +++ py/trunk/py/test/collect.py Sun Jul 1 15:44:40 2007 @@ -350,7 +350,7 @@ def run(self): if getattr(self.obj, 'disabled', 0): return [] - return PyCollectorMixin.run(self) + return super(Module, self).run() def join(self, name): res = super(Module, self).join(name) From fijal at codespeak.net Tue Jul 24 11:06:42 2007 From: fijal at codespeak.net (fijal at codespeak.net) Date: Tue, 24 Jul 2007 11:06:42 +0200 (CEST) Subject: [py-svn] r45294 - py/trunk/py/magic Message-ID: <20070724090642.02C3680F0@code0.codespeak.net> Author: fijal Date: Tue Jul 24 11:06:42 2007 New Revision: 45294 Modified: py/trunk/py/magic/greenlet.py Log: Complain loudly when there is pypy without stackless Modified: py/trunk/py/magic/greenlet.py ============================================================================== --- py/trunk/py/magic/greenlet.py (original) +++ py/trunk/py/magic/greenlet.py Tue Jul 24 11:06:42 2007 @@ -2,8 +2,10 @@ if '_stackless' in sys.builtin_module_names: # when running on top of a pypy with stackless support from _stackless import greenlet +elif hasattr(sys, 'pypy_objspaceclass'): + raise ImportError("Detected pypy without stackless support") else: - # regular CPython (or pypy without stackless support, and then crash :-) + # regular CPython import py gdir = py.path.local(py.__file__).dirpath() path = gdir.join('c-extension', 'greenlet', 'greenlet.c') From fijal at codespeak.net Tue Jul 24 11:32:44 2007 From: fijal at codespeak.net (fijal at codespeak.net) Date: Tue, 24 Jul 2007 11:32:44 +0200 (CEST) Subject: [py-svn] r45295 - in py/trunk/py/test/rsession: . testing webdata Message-ID: <20070724093244.B4F228146@code0.codespeak.net> Author: fijal Date: Tue Jul 24 11:32:44 2007 New Revision: 45295 Modified: py/trunk/py/test/rsession/testing/test_web.py py/trunk/py/test/rsession/web.py py/trunk/py/test/rsession/webdata/source.js Log: Fix rsession tests 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 Tue Jul 24 11:32:44 2007 @@ -24,7 +24,7 @@ from py.__.test.rsession import webjs from py.__.test.rsession.web import FUNCTION_LIST, IMPORTED_PYPY - source = rpython2javascript(webjs, FUNCTION_LIST) + source = rpython2javascript(webjs, FUNCTION_LIST, use_pdb=False) assert source def test_parse_args(): Modified: py/trunk/py/test/rsession/web.py ============================================================================== --- py/trunk/py/test/rsession/web.py (original) +++ py/trunk/py/test/rsession/web.py Tue Jul 24 11:32:44 2007 @@ -24,11 +24,10 @@ "show_host", "hide_host", "hide_messagebox", "opt_scroll"] try: - from pypy.rpython.ootypesystem.bltregistry import MethodDesc, BasicExternal,\ - described + from pypy.rpython.ootypesystem.bltregistry import MethodDesc, BasicExternal from pypy.translator.js.main import rpython2javascript from pypy.translator.js import commproxy - from pypy.rpython.extfunc import _callable + from pypy.translator.js.lib.support import callback commproxy.USE_MOCHIKIT = False IMPORTED_PYPY = True @@ -36,14 +35,11 @@ class BasicExternal(object): pass - def described(*args, **kwargs): + def callback(*args, **kwargs): def decorator(func): return func return decorator - def _callable(*args, **kwargs): - pass - IMPORTED_PYPY = False def add_item(event): @@ -153,22 +149,19 @@ for host in self.hosts: to_send[host.hostid] = host.hostname return to_send - show_hosts = described(retval={str:str}, args=[('callback', - _callable([{str:str}]))])(show_hosts) + show_hosts = callback(retval={str:str})(show_hosts) def show_skip(self, item_name="aa"): return {'item_name': item_name, 'reason': self.skip_reasons[item_name]} - show_skip = described(retval={str:str}, args=[('item_name',str),('callback', - _callable([{str:str}]))])(show_skip) + show_skip = callback(retval={str:str})(show_skip) def show_fail(self, item_name="aa"): return {'item_name':item_name, 'traceback':str(self.fail_reasons[item_name]), 'stdout':self.stdout[item_name], 'stderr':self.stderr[item_name]} - show_fail = described(retval={str:str}, args=[('item_name',str),('callback', - _callable([{str:str}]))])(show_fail) + show_fail = callback(retval={str:str})(show_fail) _sessids = None _sesslock = py.std.thread.allocate_lock() @@ -186,8 +179,7 @@ finally: self._sesslock.release() return sessid - show_sessid = described(retval=str, args=[('callback', - _callable([str]))])(show_sessid) + show_sessid = callback(retval=str)(show_sessid) def failed(self, **kwargs): if not 'sessid' in kwargs: @@ -201,14 +193,13 @@ del self._sessids[to_del] self.pending_events._del(kwargs['sessid']) - def show_all_statuses(self, sessid=-1): + def show_all_statuses(self, sessid='xx'): retlist = [self.show_status_change(sessid)] while not self.pending_events.empty_queue(sessid): retlist.append(self.show_status_change(sessid)) retval = retlist return retval - show_all_statuses = described(retval=[{str:str}],args= - [('sessid',str), ('callback',_callable([[{str:str}]]))])(show_all_statuses) + show_all_statuses = callback(retval=[{str:str}])(show_all_statuses) def show_status_change(self, sessid): event = self.pending_events.get(sessid) @@ -408,7 +399,8 @@ def run_jssource(self): js_name = py.path.local(__file__).dirpath("webdata").join("source.js") web_name = py.path.local(__file__).dirpath().join("webjs.py") - if IMPORTED_PYPY and web_name.mtime() > js_name.mtime(): + if IMPORTED_PYPY and web_name.mtime() > js_name.mtime() or \ + (not js_name.check()) or 1: from py.__.test.rsession import webjs javascript_source = rpython2javascript(webjs, Modified: py/trunk/py/test/rsession/webdata/source.js ============================================================================== Binary files. No diff available.