1TRIAL(1) TRIAL(1)
2
3
4
6 trial - run unit tests
7
9 trial [options] [[file|package|module|TestCase|testmethod]...]
10
11 trial --help
12
14 trial loads and executes a suite of unit tests, obtained from modules,
15 packages and files listed on the command line.
16
17 trial will take either filenames or fully qualified Python names as
18 arguments. Thus 'trial myproject/foo.py', 'trial myproject.foo' and
19 'trial myproject.foo.SomeTestCase.test_method' are all valid ways to
20 invoke trial.
21
22 -b, --debug
23 Run the tests in the Python debugger. Also does post-mortem
24 debugging on exceptions. Will load '.pdbrc' from current direc‐
25 tory if it exists.
26
27 -B, --debug-stacktraces
28 Report Deferred creation and callback stack traces
29
30 --coverage
31 Generate coverage information in _trial_temp/coverage/. Requires
32 Python 2.3 or higher.
33
34 --disablegc
35 Disable the garbage collector. I don't know why this is in
36 trial.
37
38 -x, --extra
39 Add an extra argument. (This is a hack necessary for interfacing
40 with emacs's `gud'.)
41
42 -e, --rterrors
43 Print tracebacks to standard output as soon as they occur
44
45 --force-gc
46 Run gc.collect() before and after each test case. This can be
47 used to isolate errors that occur when objects get collected.
48 This option would be the default, except it makes tests run
49 about ten times slower.
50
51 -h, --help
52 Print a usage message to standard output, then exit.
53
54 --help-reporters
55 Print a list of valid reporters to standard output, then exit.
56
57 --help-reactors
58 List the names of possibly available reactors.
59
60 -l, --logfile <logfile>
61 Direct the log to a different file. The default file is
62 'test.log'. <logfile> is relative to _trial_temp.
63
64 -n, --dry-run
65 Go through all the tests and make them pass without running.
66
67 -N, --no-recurse
68 By default, trial recurses through packages to find every module
69 inside every subpackage. Unless, that is, you specify this
70 option.
71
72 --nopm Don't automatically jump into debugger for post-mortem analysis
73 of exceptions. Only usable in conjunction with --debug.
74
75 --profile
76 Run tests under the Python profiler.
77
78 -r, --reactor <reactor>
79 Choose which reactor to use. See --help-reactors for a list.
80
81 --recursionlimit
82 Set Python's recursion limit. See sys.setrecursionlimit()
83
84 --reporter
85 Select the reporter to use for Trial's output. Use the --help-
86 reporters option to see a list of valid reporters.
87
88 --spew Print an insanely verbose log of everything that happens. Useful
89 when debugging freezes or locks in complex code.
90
91 --tbformat <format>
92 Format to display tracebacks with. Acceptable values are
93 'default', 'brief' and 'verbose'. 'brief' produces tracebacks
94 that play nicely with Emacs' GUD.
95
96 --temp-directory <directory>
97 WARNING: Do not use this options unless you know what you are
98 doing. By default, trial creates a directory called _trial_temp
99 under the current working directory. When trial runs, it first
100 deletes this directory, then creates it, then changes into the
101 directory to run the tests. The log file and any coverage files
102 are stored here. Use this option if you wish to have trial run
103 in a directory other than _trial_temp. Be warned, trial will
104 delete the directory before re-creating it.
105
106 --testmodule <filename>
107 Ask trial to look into <filename> and run any tests specified
108 using the Emacs-style buffer variable 'test-case-name'.
109
110 --unclean-warnings
111 As of Twisted 8.0, trial will report an error if the reactor is
112 left unclean at the end of the test. This option is provided to
113 assist in migrating from Twisted 2.5 to Twisted 8.0 and later.
114 Enabling this option will turn the errors into warnings.
115
116 -u, --until-failure
117 Keep looping the tests until one of them raises an error or a
118 failure. This is particularly useful for reproducing intermit‐
119 tent failures.
120
121 --version
122 Prints the Twisted version number and exit.
123
124 --without-module <modulenames>
125 Simulate the lack of the specified comma-separated list of mod‐
126 ules. This makes it look like the modules are not present in the
127 system, causing tests to check the behavior for that configura‐
128 tion.
129
130 -z, --random [<seed>]
131 Run the tests in random order using the specified seed.
132
134 Written by Jonathan M. Lange
135
137 To report a bug, visit http://twistedmatrix.com/bugs/
138
140 Copyright © 2003-2008 Twisted Matrix Laboratories
141 This is free software; see the source for copying conditions. There is
142 NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
143 PURPOSE.
144
145
146
147 Oct 2007 TRIAL(1)