[pypy-dev] Pypy frontend/ testall.py

Rocco Moretti roccomoretti at netscape.net
Tue Mar 4 03:17:25 CET 2003


"logistix" <vze55z8s at verizon.net> wrote:

>I've written a small script that'll allow you to run .py scripts via
>pypy.  Ultimately, it'll incorporate all of the functionality of calling
>'python' from the command-line.  

Great! I wanted something like this over the weekend. (Have you been 
borrowing Guido's time machine?)

>Normally, I'd get some more work done
>before distributing it, but it is enough to run testall.py in the test
>directory, so I thought it might be of interest.

N.B. If you look at the implementation of testall.py (at least for 2.2.2) 
it's just a hack which fiddles with sys.argv and then calls into 
test.regrtest (I mention this because regrtest.py has different output 
formating features which look much nicer than the verbose output of 
testall.py.

>It should be noted that testall.py fails quite spectacularly, as can be
>expected at this point, and aborts execution.  

That's interesting - Which platform and ObjSpace were you using?

When I tried this weekend with TrivialObjSpace under Python 2.2.2 on Win98 
the results were encouraging - most of the tests passed (eventually). 

One MAJOR caveat on that issue is that I had to edit regrtest.py to get it 
to work. Out of the box all the tests failed miserably with "Module Not 
Found Errors". regrtest.py assumes that tests are in test_???.py files in 
the current package level (Lib/test, but the level is implicit). However, 
when the pypy interpreter runs an import, the import runs local in the 
Lib/pypy/interpreter package - no test_??? files are found.

Additionally, when testing, an "import test" opens the "test" submodule of 
Lib/pypy/interpreter.

If you delete/rename the test directory, and edit regrtest.py such that it 
does an absolute import:

Change: the_module = __import__(test, globals(), locals(), [])
to: the_module = __import__("test", globals(), locals(), [test])

then testall/regrtest is happy. 

(No, I don't think this is a long-term solution to the problem ...)
-Rocco

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


More information about the Pypy-dev mailing list