|
15 | 15 | Run Python regression tests. |
16 | 16 |
|
17 | 17 | If no arguments or options are provided, finds all files matching |
18 | | -the pattern "test_*" in the Lib/test subdirectory and runs |
19 | | -them in alphabetical order (but see -M and -u, below, for exceptions). |
| 18 | +the pattern `test_*` in the `Lib/test` subdirectory and runs |
| 19 | +them in alphabetical order (but see `-M` and `-u`, below, for exceptions). |
20 | 20 |
|
21 | 21 | For more rigorous testing, it is useful to use the following |
22 | 22 | command line: |
23 | 23 |
|
24 | | -python -E -Wd -m test [options] [test_name1 ...] |
| 24 | +`python -E -Wd -m test [options] [test_name1 ...]` |
25 | 25 | """ |
26 | 26 |
|
27 | 27 | EPILOG = """\ |
28 | 28 | Additional option details: |
29 | 29 |
|
30 | | --r randomizes test execution order. You can use --randseed=int to provide an |
31 | | -int seed value for the randomizer. The randseed value will be used |
| 30 | +`-r` randomizes test execution order. You can use `--randseed=int` to provide an |
| 31 | +int seed value for the randomizer. The `randseed` value will be used |
32 | 32 | to set seeds for all random usages in tests |
33 | | -(including randomizing the tests order if -r is set). |
| 33 | +(including randomizing the tests order if `-r` is set). |
34 | 34 | By default we always set random seed, but do not randomize test order. |
35 | 35 |
|
36 | | --s On the first invocation of regrtest using -s, the first test file found |
| 36 | +`-s` On the first invocation of regrtest using `-s`, the first test file found |
37 | 37 | or the first test file given on the command line is run, and the name of |
38 | | -the next test is recorded in a file named pynexttest. If run from the |
39 | | -Python build directory, pynexttest is located in the 'build' subdirectory, |
40 | | -otherwise it is located in tempfile.gettempdir(). On subsequent runs, |
41 | | -the test in pynexttest is run, and the next test is written to pynexttest. |
42 | | -When the last test has been run, pynexttest is deleted. In this way it |
| 38 | +the next test is recorded in a file named `pynexttest`. If run from the |
| 39 | +Python build directory, `pynexttest` is located in the 'build' subdirectory, |
| 40 | +otherwise it is located in `tempfile.gettempdir()`. On subsequent runs, |
| 41 | +the test in `pynexttest` is run, and the next test is written to `pynexttest`. |
| 42 | +When the last test has been run, `pynexttest` is deleted. In this way it |
43 | 43 | is possible to single step through the test files. This is useful when |
44 | 44 | doing memory analysis on the Python interpreter, which process tends to |
45 | 45 | consume too many resources to run the full regression test non-stop. |
46 | 46 |
|
47 | | --S is used to resume running tests after an interrupted run. It will |
48 | | -maintain the order a standard run (i.e. it assumes -r is not used). |
| 47 | +`-S` is used to resume running tests after an interrupted run. It will |
| 48 | +maintain the order a standard run (i.e. it assumes `-r` is not used). |
49 | 49 | This is useful after the tests have prematurely stopped for some external |
50 | 50 | reason and you want to resume the run from where you left off rather |
51 | | -than starting from the beginning. Note: this is different from --prioritize. |
| 51 | +than starting from the beginning. Note: this is different from `--prioritize`. |
52 | 52 |
|
53 | | ---prioritize is used to influence the order of selected tests, such that |
| 53 | +`--prioritize` is used to influence the order of selected tests, such that |
54 | 54 | the tests listed as an argument are executed first. This is especially |
55 | | -useful when combined with -j and -r to pin the longest-running tests |
56 | | -to start at the beginning of a test run. Pass --prioritize=test_a,test_b |
57 | | -to make test_a run first, followed by test_b, and then the other tests. |
58 | | -If test_a wasn't selected for execution by regular means, --prioritize will |
| 55 | +useful when combined with `-j` and `-r` to pin the longest-running tests |
| 56 | +to start at the beginning of a test run. Pass `--prioritize=test_a,test_b` |
| 57 | +to make `test_a` run first, followed by `test_b`, and then the other tests. |
| 58 | +If test_a wasn't selected for execution by regular means, `--prioritize` will |
59 | 59 | not make it execute. |
60 | 60 |
|
61 | | --f reads the names of tests from the file given as f's argument, one |
| 61 | +`-f` reads the names of tests from the file given as `f`'s argument, one |
62 | 62 | or more test names per line. Whitespace is ignored. Blank lines and |
63 | | -lines beginning with '#' are ignored. This is especially useful for |
| 63 | +lines beginning with `#` are ignored. This is especially useful for |
64 | 64 | whittling down failures involving interactions among tests. |
65 | 65 |
|
66 | | --L causes the leaks(1) command to be run just before exit if it exists. |
67 | | -leaks(1) is available on Mac OS X and presumably on some other |
| 66 | +`-L` causes the leaks(1) command to be run just before exit if it exists. |
| 67 | +leaks(1) is available on macOS and presumably on some other |
68 | 68 | FreeBSD-derived systems. |
69 | 69 |
|
70 | | --R runs each test several times and examines sys.gettotalrefcount() to |
| 70 | +`-R` runs each test several times and examines `sys.gettotalrefcount()` to |
71 | 71 | see if the test appears to be leaking references. The argument should |
72 | | -be of the form stab:run:fname where 'stab' is the number of times the |
73 | | -test is run to let gettotalrefcount settle down, 'run' is the number |
74 | | -of times further it is run and 'fname' is the name of the file the |
75 | | -reports are written to. These parameters all have defaults (5, 4 and |
76 | | -"reflog.txt" respectively), and the minimal invocation is '-R :'. |
| 72 | +be of the form `stab:run:fname` where `stab` is the number of times the |
| 73 | +test is run to let gettotalrefcount settle down, `run` is the number |
| 74 | +of times further it is run and `fname` is the name of the file the |
| 75 | +reports are written to. These parameters all have defaults (`5`, `4` and |
| 76 | +`"reflog.txt"` respectively), and the minimal invocation is `-R :`. |
77 | 77 |
|
78 | | --M runs tests that require an exorbitant amount of memory. These tests |
| 78 | +`-M` runs tests that require an exorbitant amount of memory. These tests |
79 | 79 | typically try to ascertain containers keep working when containing more than |
80 | 80 | 2 billion objects, which only works on 64-bit systems. There are also some |
81 | 81 | tests that try to exhaust the address space of the process, which only makes |
82 | 82 | sense on 32-bit systems with at least 2Gb of memory. The passed-in memlimit, |
83 | | -which is a string in the form of '2.5Gb', determines how much memory the |
84 | | -tests will limit themselves to (but they may go slightly over.) The number |
| 83 | +which is a string in the form of `'2.5Gb'`, determines how much memory the |
| 84 | +tests will limit themselves to (but they may go slightly over). The number |
85 | 85 | shouldn't be more memory than the machine has (including swap memory). You |
86 | 86 | should also keep in mind that swap memory is generally much, much slower |
87 | 87 | than RAM, and setting memlimit to all available RAM or higher will heavily |
|
90 | 90 | to use more than memlimit memory will be skipped. The big-memory tests |
91 | 91 | generally run very, very long. |
92 | 92 |
|
93 | | --u is used to specify which special resource intensive tests to run, |
| 93 | +`-u` is used to specify which special resource intensive tests to run, |
94 | 94 | such as those requiring large file support or network connectivity. |
95 | 95 | The argument is a comma-separated list of words indicating the |
96 | 96 | resources to test. Currently only the following are defined: |
|
137 | 137 | wantobjects - Allows to run Tkinter tests with the specified value of |
138 | 138 | tkinter.wantobjects. |
139 | 139 |
|
140 | | -To enable all resources except one, use '-uall,-<resource>'. For |
141 | | -example, to run all the tests except for the gui tests, give the |
142 | | -option '-uall,-gui'. |
| 140 | +To enable all resources except one, use `-uall,-<resource>`. For |
| 141 | +example, to run all the tests except for the `gui` tests, give the |
| 142 | +option `-uall,-gui`. |
143 | 143 |
|
144 | | ---matchfile filters tests using a text file, one pattern per line. |
| 144 | +`--matchfile` filters tests using a text file, one pattern per line. |
145 | 145 | Pattern examples: |
146 | 146 |
|
147 | | -- test method: test_stat_attributes |
148 | | -- test class: FileTests |
149 | | -- test identifier: test_os.FileTests.test_stat_attributes |
| 147 | +- test method: `test_stat_attributes` |
| 148 | +- test class: `FileTests` |
| 149 | +- test identifier: `test_os.FileTests.test_stat_attributes` |
150 | 150 | """ |
151 | 151 |
|
152 | 152 |
|
|
0 commit comments