1
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html lang="en" xmlns="http://www.w3.org/1999/xhtml">
3
<title>Twisted Documentation: TRIAL.1</title>
4
<link href="../howto/stylesheet.css" rel="stylesheet" type="text/css"/>
8
<h1 class="title">TRIAL.1</h1>
9
<div class="toc"><ol><li><a href="#auto0">NAME</a></li><li><a href="#auto1">SYNOPSIS</a></li><li><a href="#auto2">DESCRIPTION</a></li><li><a href="#auto3">AUTHOR</a></li><li><a href="#auto4">REPORTING BUGS</a></li><li><a href="#auto5">COPYRIGHT</a></li></ol></div>
14
<h2>NAME<a name="auto0"/></h2>
16
<p>trial - run unit tests
19
<h2>SYNOPSIS<a name="auto1"/></h2>
21
<p><strong>trial</strong> [options] [[file|package|module|TestCase|testmethod]...]</p>
23
<p><strong>trial</strong> --help</p>
25
<h2>DESCRIPTION<a name="auto2"/></h2>
27
<p>trial loads and executes a suite of unit tests, obtained from modules,
28
packages and files listed on the command line.
31
<p>trial will take either filenames or fully qualified Python names as
32
arguments. Thus 'trial myproject/foo.py', 'trial myproject.foo' and
33
'trial myproject.foo.SomeTestCase.test_method' are all valid ways to
35
<dl><dt><strong>-b</strong>, <strong>--debug</strong>
36
</dt><dd>Run the tests in the Python debugger. Also does post-mortem
37
debugging on exceptions. Will load '.pdbrc' from current directory if
41
<dt><strong>-B</strong>, <strong>--debug-stacktraces</strong>
42
</dt><dd>Report Deferred creation and callback stack traces
45
<dt><strong>--coverage</strong>
46
</dt><dd>Generate coverage information in _trial_temp/coverage/. Requires Python 2.3
50
<dt><strong>--disablegc</strong>
51
</dt><dd>Disable the garbage collector. I don't know why this is in trial.
54
<dt><strong>-x</strong>, <strong>--extra</strong>
55
</dt><dd>Add an extra argument. (This is a hack necessary for interfacing with emacs's
59
<dt><strong>-e</strong>, <strong>--rterrors</strong>
60
</dt><dd>Print tracebacks to standard output as soon as they occur
63
<dt><strong>--force-gc</strong>
64
</dt><dd>Run gc.collect() before and after each test case. This can be used to
65
isolate errors that occur when objects get collected. This option would be
66
the default, except it makes tests run about ten times slower.
69
<dt><strong>-h</strong>, <strong>--help</strong>
70
</dt><dd>Print a usage message to standard output, then exit.
73
<dt><strong>--help-reporters</strong>
74
</dt><dd>Print a list of valid reporters to standard output, then exit.
77
<dt><strong>--help-reactors</strong>
78
</dt><dd>List the names of possibly available reactors.
81
<dt><strong>-l</strong>, <strong>--logfile</strong> <logfile>
82
</dt><dd>Direct the log to a different file. The default file is 'test.log'.
83
<logfile> is relative to _trial_temp.
86
<dt><strong>-n</strong>, <strong>--dry-run</strong>
87
</dt><dd>Go through all the tests and make them pass without running.
90
<dt><strong>-N</strong>, <strong>--no-recurse</strong>
91
</dt><dd>By default, trial recurses through packages to find every module inside
92
every subpackage. Unless, that is, you specify this option.
95
<dt><strong>--nopm</strong>
96
</dt><dd>Don't automatically jump into debugger for post-mortem analysis of
97
exceptions. Only usable in conjunction with --debug.
100
<dt><strong>--profile</strong>
101
</dt><dd>Run tests under the Python profiler.
104
<dt><strong>-r</strong>, <strong>--reactor</strong> <em><reactor></em>
105
</dt><dd>Choose which reactor to use. See --help-reactors for a list.
108
<dt><strong>--recursionlimit</strong>
109
</dt><dd>Set Python's recursion limit. See sys.setrecursionlimit()
112
<dt><strong>--reporter</strong>
113
</dt><dd>Select the reporter to use for Trial's output. Use the --help-reporters
114
option to see a list of valid reporters.
117
<dt><strong>--spew</strong>
118
</dt><dd>Print an insanely verbose log of everything that happens. Useful when
119
debugging freezes or locks in complex code.
122
<dt><strong>--tbformat</strong> <format>
123
</dt><dd>Format to display tracebacks with. Acceptable values are 'default', 'brief'
124
and 'verbose'. 'brief' produces tracebacks that play nicely with Emacs' GUD.
127
<dt><strong>--temp-directory <directory></strong>
128
</dt><dd>WARNING: Do not use this options unless you know what you are doing.
129
By default, trial creates a directory called _trial_temp under the current
130
working directory. When trial runs, it first <em>deletes</em> this directory,
131
then creates it, then changes into the directory to run the tests. The log
132
file and any coverage files are stored here. Use this option if you wish to
133
have trial run in a directory other than _trial_temp. Be warned, trial
134
will <em>delete</em> the directory before re-creating it.
137
<dt><strong>--testmodule <filename></strong>
138
</dt><dd>Ask trial to look into <filename> and run any tests specified using the
139
Emacs-style buffer variable 'test-case-name'.
142
<dt><strong>--unclean-warnings</strong>
143
</dt><dd>As of Twisted 8.0, trial will report an error if the reactor is left unclean
144
at the end of the test. This option is provided to assist in migrating from
145
Twisted 2.5 to Twisted 8.0 and later. Enabling this option will turn the errors
149
<dt><strong>-u</strong>, <strong>--until-failure</strong>
150
</dt><dd>Keep looping the tests until one of them raises an error or a failure.
151
This is particularly useful for reproducing intermittent failures.
154
<dt><strong>--version</strong>
155
</dt><dd>Prints the Twisted version number and exit.
158
<dt><strong>--without-module <modulenames></strong>
159
</dt><dd>Simulate the lack of the specified comma-separated list of modules. This makes
160
it look like the modules are not present in the system, causing tests to check
161
the behavior for that configuration.
164
<dt><strong>-z</strong>, <strong>--random [<seed>]</strong>
165
</dt><dd>Run the tests in random order using the specified seed.
172
<h2>AUTHOR<a name="auto3"/></h2>
174
<p>Written by Jonathan M. Lange
177
<h2>REPORTING BUGS<a name="auto4"/></h2>
179
<p>To report a bug, visit <em>http://twistedmatrix.com/bugs/</em>
182
<h2>COPYRIGHT<a name="auto5"/></h2>
184
<p>Copyright © 2003-2008 Twisted Matrix Laboratories
185
This is free software; see the source for copying conditions. There is NO
186
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
191
<p><a href="../howto/index.html">Index</a></p>
192
<span class="version">Version: 10.0.0</span>
b'\\ No newline at end of file'