Author: Alex Gaynor <alex.gay...@gmail.com> Branch: kill-faking Changeset: r59263:e7c95429e35c Date: 2012-12-02 14:59 -0800 http://bitbucket.org/pypy/pypy/changeset/e7c95429e35c/
Log: fix __pypy__ tests (removed isfake, nothing is fake!) diff --git a/pypy/module/__pypy__/__init__.py b/pypy/module/__pypy__/__init__.py --- a/pypy/module/__pypy__/__init__.py +++ b/pypy/module/__pypy__/__init__.py @@ -59,7 +59,6 @@ def setup_after_space_initialization(self): """NOT_RPYTHON""" if not self.space.config.translating: - self.extra_interpdef('isfake', 'interp_magic.isfake') self.extra_interpdef('interp_pdb', 'interp_magic.interp_pdb') if self.space.config.objspace.std.withmethodcachecounter: self.extra_interpdef('method_cache_counter', diff --git a/pypy/module/__pypy__/interp_magic.py b/pypy/module/__pypy__/interp_magic.py --- a/pypy/module/__pypy__/interp_magic.py +++ b/pypy/module/__pypy__/interp_magic.py @@ -7,16 +7,10 @@ from pypy.objspace.std.mapdict import IndexCache from pypy.rlib import rposix + def internal_repr(space, w_object): return space.wrap('%r' % (w_object,)) -def isfake(space, w_obj): - """Return whether the argument is faked (stolen from CPython). This is - always False after translation.""" - if we_are_translated(): - return space.w_False - return space.wrap(bool(w_obj.typedef.fakedcpytype)) - #return space.wrap(bool(getattr(w_obj.typedef, 'fakedcpytype', None))) def interp_pdb(space): """Run an interp-level pdb. @@ -25,6 +19,7 @@ import pdb pdb.set_trace() + @unwrap_spec(name=str) def method_cache_counter(space, name): """Return a tuple (method_cache_hits, method_cache_misses) for calls to diff --git a/pypy/module/__pypy__/test/test_debug.py b/pypy/module/__pypy__/test/test_debug.py --- a/pypy/module/__pypy__/test/test_debug.py +++ b/pypy/module/__pypy__/test/test_debug.py @@ -1,13 +1,16 @@ import py + +from pypy.interpreter.gateway import interp2app from pypy.rlib import debug + class AppTestDebug: spaceconfig = dict(usemodules=['__pypy__']) def setup_class(cls): if cls.runappdirect: py.test.skip("not meant to be run with -A") - cls.w_check_log = cls.space.wrap(cls.check_log) + cls.w_check_log = cls.space.wrap(interp2app(cls.check_log)) def setup_method(self, meth): debug._log = debug.DebugLog() @@ -15,9 +18,9 @@ def teardown_method(self, meth): debug._log = None - @classmethod - def check_log(cls, expected): - assert list(debug._log) == expected + @staticmethod + def check_log(space, w_expected): + assert list(debug._log) == space.unwrap(w_expected) def test_debug_print(self): from __pypy__ import debug_start, debug_stop, debug_print diff --git a/pypy/module/__pypy__/test/test_special.py b/pypy/module/__pypy__/test/test_special.py --- a/pypy/module/__pypy__/test/test_special.py +++ b/pypy/module/__pypy__/test/test_special.py @@ -8,17 +8,6 @@ if cls.runappdirect: py.test.skip("does not make sense on pypy-c") - def test__isfake(self): - from __pypy__ import isfake - assert not isfake(map) - assert not isfake(object) - assert not isfake(isfake) - - def test__isfake_currently_true(self): - from __pypy__ import isfake - import select - assert isfake(select) - def test_cpumodel(self): import __pypy__ assert hasattr(__pypy__, 'cpumodel') _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit