[pypy-dev] How to test code in pypy.rpython?

Amaury Forgeot d'Arc amauryfa at gmail.com
Mon Aug 22 08:13:37 CEST 2011


Hi,

2011/8/22 Mitchell Hashimoto <mitchell.hashimoto at gmail.com>

> I've been working on some 'os' standard library methods, which requires
> some interp-level code in pypy.rpython.module.ll_os.
>
> I noticed that while in the "py.py" interpreter that the methods I've been
> adding to "os" have been using CPython's library. I've written unit tests
> which appear to actually test the ll_os code and it seems to work, and I can
> also always drop back into the interp-level repl and do a
> "extregistry.lookup(fn).lltypeimpl" trick to get the method and it seems to
> work there as well.
>
> But it would still be great to see the whole thing work without having to
> translate all of PyPy. Is this possible?
>

Sure, you must write unit tests anyway.
Add your ones in pypy/rpython/module/test/test_ll_os.py,
there are already many examples there.
(the magic function is getllimpl(), which returns the low-level function)

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110822/744d1a8e/attachment.html>


More information about the pypy-dev mailing list