[Pythonmac-SIG] install test

kevin kevin at macosx.com
Mon Sep 1 22:53:09 EDT 2003


It used to be (Python 2.2 or thereabouts) that there was a readme file  
that told you how to run some tests after you installed python to make  
sure all was groovy. I think that it was:

 >>> import test.regrtest
 >>> test.regrtest.main()

and then it would chug away and usually fail one or two silly tests  
that you could ignore and rest easily knowing that you got your python  
installed okay and you was ready to hack some code.

is there some such test to run on 2.3? i tried the above and not much  
happened

 >>> import test.regrtest

was okay then i tried to run the thing with test.regrtest.main()" and  
got the following silliness:

Python 2.3 (#2, Jul 30 2003, 11:45:28)
[GCC 3.1 20020420 (prerelease)]
Type "copyright", "credits" or "license" for more information.
MacPython IDE 1.0.1
 >>> import test.regrtest
 >>> test.regrtest.main()
Regression test.

This will find all modules whose name is "test_*" in the test
directory, and run them.  Various command line options provide
additional facilities.

Command line options:

-v: verbose   -- run tests in verbose mode with output to stdout
-q: quiet     -- don't print anything except if a test fails
-g: generate  -- write the output file for a test instead of comparing  
it
-x: exclude   -- arguments are tests to *exclude*
-s: single    -- run only a single test (see below)
-r: random    -- randomize test execution order
-f: fromfile  -- read names of tests to run from a file (see below)
-l: findleaks -- if GC is available detect tests that leak memory
-u: use       -- specify which special resource intensive tests to run
-h: help      -- print this text and exit
-t: threshold -- call gc.set_threshold(N)

If non-option arguments are present, they are names for tests to run,
unless -x is given, in which case they are names for tests not to run.
If no test names are given, all tests are run.

-v is incompatible with -g and does not compare test output files.

-s means to run only a single test and exit.  This is useful when
doing memory analysis on the Python interpreter (which tend to consume
too many resources to run the full regression test non-stop).  The
file /tmp/pynexttest is read to find the next test to run.  If this
file is missing, the first test_*.py file in testdir or on the command
line is used.  (actually tempfile.gettempdir() is used instead of
/tmp).

-f reads the names of tests from the file given as f's argument, one
or more test names per line.  Whitespace is ignored.  Blank lines and
lines beginning with '#' are ignored.  This is especially useful for
whittling down failures involving interactions among tests.

-u is used to specify which special resource intensive tests to run,
such as those requiring large file support or network connectivity.
The argument is a comma-separated list of words indicating the
resources to test.  Currently only the following are defined:

     all -       Enable all special resources.

     audio -     Tests that use the audio device.  (There are known
                 cases of broken audio drivers that can crash Python or
                 even the Linux kernel.)

     curses -    Tests that use curses and will modify the terminal's
                 state and output modes.

     largefile - It is okay to run some test that may create huge
                 files.  These tests can take a long time and may
                 consume >2GB of disk space temporarily.

     network -   It is okay to run tests that use external network
                 resource, e.g. testing SSL support for sockets.

     bsddb -     It is okay to run the bsddb testsuite, which takes
                 a long time to complete.

To enable all resources except one, use '-uall,-<resource>'.  For
example, to run all the tests except for the bsddb tests, give the
option '-uall,-bsddb'.

option -p not recognized
Traceback (most recent call last):
   File "<input>", line 1, in ?
   File  
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/test/ 
regrtest.py", line 150, in main
     usage(2, msg)
   File  
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/test/ 
regrtest.py", line 114, in usage
     sys.exit(code)
SystemExit: 2

---


What's up with that?

cheers,
kevin parks




More information about the Pythonmac-SIG mailing list