3
<title>nose: nose.failure</title>
4
<link rel="stylesheet" href="site.css" type="text/css"></link>
9
<p>This document covers nose version <b>0.10.3</b></p>
10
<p>Last update: <b>Tue Jun 3 11:50:26 2008</b></p>
11
<h2>Plugins</h2><ul><li><a href="plugin_attrib.html">Builtin Plugin: attrib</a></li><li><a href="plugin_capture.html">Builtin Plugin: capture</a></li><li><a href="plugin_cover.html">Builtin Plugin: cover</a></li><li><a href="plugin_debug.html">Builtin Plugin: debug</a></li><li><a href="plugin_deprecated.html">Builtin Plugin: deprecated</a></li><li><a href="plugin_doctests.html">Builtin Plugin: doctests</a></li><li><a href="plugin_failuredetail.html">Builtin Plugin: failuredetail</a></li><li><a href="plugin_isolate.html">Builtin Plugin: isolate</a></li><li><a href="plugin_prof.html">Builtin Plugin: prof</a></li><li><a href="plugin_skip.html">Builtin Plugin: skip</a></li><li><a href="plugin_testid.html">Builtin Plugin: testid</a></li><li><a href="error_class_plugin.html">ErrorClass Plugins</a></li><li><a href="plugin_interface.html">Plugin Interface</a></li><li><a href="writing_plugins.html">Writing Plugins</a></li></ul><h2>Modules</h2><ul><li><a href="module_nose.case.html">Module: nose.case</a></li><li><a href="module_nose.commands.html">Module: nose.commands</a></li><li><a href="module_nose.config.html">Module: nose.config</a></li><li><a href="module_nose.core.html">Module: nose.core</a></li><li><a href="module_nose.exc.html">Module: nose.exc</a></li><li><a href="module_nose.failure.html">Module: nose.failure</a></li><li><a href="module_nose.importer.html">Module: nose.importer</a></li><li><a href="module_nose.inspector.html">Module: nose.inspector</a></li><li><a href="module_nose.loader.html">Module: nose.loader</a></li><li><a href="module_nose.plugins.manager.html">Module: nose.plugins.manager</a></li><li><a href="module_nose.plugins.plugintest.html">Module: nose.plugins.plugintest</a></li><li><a href="module_nose.proxy.html">Module: nose.proxy</a></li><li><a href="module_nose.result.html">Module: nose.result</a></li><li><a href="module_nose.selector.html">Module: nose.selector</a></li><li><a href="module_nose.suite.html">Module: nose.suite</a></li><li><a href="module_nose.tools.html">Module: nose.tools</a></li><li><a href="module_nose.twistedtools.html">Module: nose.twistedtools</a></li><li><a href="module_nose.util.html">Module: nose.util</a></li></ul><h2>Plugin Examples</h2><ul><li><a href="unwanted_package.html">Excluding Unwanted Packages</a></li><li><a href="errorclass_failure.html">Failure of Errorclasses</a></li><li><a href="imported_tests.html">Importing Tests</a></li><li><a href="empty_plugin.html">Minimal plugin</a></li><li><a href="restricted_plugin_options.html">Restricted Plugin Managers</a></li><li><a href="init_plugin.html">Running Initialization Code Before the Test Run</a></li><li><a href="selector_plugin.html">Using a Custom Selector</a></li><li><a href="plugin_exceptions.html">When Plugins Fail</a></li><li><a href="plugintest_environment.html">nose.plugins.plugintest, os.environ and sys.argv</a></li></ul>
12
<h2>Classes</h2><ul><li><a href="#Failure">Failure</a></li></ul>
16
<h1>nose: nose.failure</h1>
19
<p>Highlighted methods are defined in this class.</p><a name="Failure"></a><div class="cls section"><span class="cls name">Failure</span> (unittest.TestCase)<div class="cls doc"><h3>Methods</h3><div class="method section inherited"><span class="method name">_TestCase__exc_info<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Return a version of sys.exc_info() with the traceback frame
20
minimised; usually the top level of the traceback frame is not
22
</div></div><div class="method section inherited"><span class="method name">__call__<span class="args">(self, *args, **kwds)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"></div></div><div class="method section"><span class="method name">__init__<span class="args">(self, exc_class, exc_val, tb=None)</span></span><div class="method doc"></div></div><div class="method section inherited"><span class="method name">assertAlmostEqual<span class="args">(self, first, second, places=7, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are unequal as determined by their
23
difference rounded to the given number of decimal places
24
(default 7) and comparing to zero.</p>
25
<p>Note that decimal places (from zero) are usually not the same
26
as significant digits (measured from the most signficant digit).</p>
27
</div></div><div class="method section inherited"><span class="method name">assertAlmostEquals<span class="args">(self, first, second, places=7, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are unequal as determined by their
28
difference rounded to the given number of decimal places
29
(default 7) and comparing to zero.</p>
30
<p>Note that decimal places (from zero) are usually not the same
31
as significant digits (measured from the most signficant digit).</p>
32
</div></div><div class="method section inherited"><span class="method name">assertEqual<span class="args">(self, first, second, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are unequal as determined by the '=='
34
</div></div><div class="method section inherited"><span class="method name">assertEquals<span class="args">(self, first, second, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are unequal as determined by the '=='
36
</div></div><div class="method section inherited"><span class="method name">assertFalse<span class="args">(self, expr, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail the test if the expression is true.</p>
37
</div></div><div class="method section inherited"><span class="method name">assertNotAlmostEqual<span class="args">(self, first, second, places=7, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are equal as determined by their
38
difference rounded to the given number of decimal places
39
(default 7) and comparing to zero.</p>
40
<p>Note that decimal places (from zero) are usually not the same
41
as significant digits (measured from the most signficant digit).</p>
42
</div></div><div class="method section inherited"><span class="method name">assertNotAlmostEquals<span class="args">(self, first, second, places=7, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are equal as determined by their
43
difference rounded to the given number of decimal places
44
(default 7) and comparing to zero.</p>
45
<p>Note that decimal places (from zero) are usually not the same
46
as significant digits (measured from the most signficant digit).</p>
47
</div></div><div class="method section inherited"><span class="method name">assertNotEqual<span class="args">(self, first, second, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are equal as determined by the '=='
49
</div></div><div class="method section inherited"><span class="method name">assertNotEquals<span class="args">(self, first, second, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are equal as determined by the '=='
51
</div></div><div class="method section inherited"><span class="method name">assertRaises<span class="args">(self, excClass, callableObj, *args, **kwargs)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail unless an exception of class excClass is thrown
52
by callableObj when invoked with arguments args and keyword
53
arguments kwargs. If a different type of exception is
54
thrown, it will not be caught, and the test case will be
55
deemed to have suffered an error, exactly as for an
56
unexpected exception.</p>
57
</div></div><div class="method section inherited"><span class="method name">assertTrue<span class="args">(self, expr, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail the test unless the expression is true.</p>
58
</div></div><div class="method section inherited"><span class="method name">assert_<span class="args">(self, expr, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail the test unless the expression is true.</p>
59
</div></div><div class="method section inherited"><span class="method name">countTestCases<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"></div></div><div class="method section inherited"><span class="method name">debug<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Run the test without collecting errors in a TestResult</p>
60
</div></div><div class="method section inherited"><span class="method name">defaultTestResult<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"></div></div><div class="method section inherited"><span class="method name">fail<span class="args">(self, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail immediately, with the given message.</p>
61
</div></div><div class="method section inherited"><span class="method name">failIf<span class="args">(self, expr, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail the test if the expression is true.</p>
62
</div></div><div class="method section inherited"><span class="method name">failIfAlmostEqual<span class="args">(self, first, second, places=7, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are equal as determined by their
63
difference rounded to the given number of decimal places
64
(default 7) and comparing to zero.</p>
65
<p>Note that decimal places (from zero) are usually not the same
66
as significant digits (measured from the most signficant digit).</p>
67
</div></div><div class="method section inherited"><span class="method name">failIfEqual<span class="args">(self, first, second, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are equal as determined by the '=='
69
</div></div><div class="method section inherited"><span class="method name">failUnless<span class="args">(self, expr, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail the test unless the expression is true.</p>
70
</div></div><div class="method section inherited"><span class="method name">failUnlessAlmostEqual<span class="args">(self, first, second, places=7, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are unequal as determined by their
71
difference rounded to the given number of decimal places
72
(default 7) and comparing to zero.</p>
73
<p>Note that decimal places (from zero) are usually not the same
74
as significant digits (measured from the most signficant digit).</p>
75
</div></div><div class="method section inherited"><span class="method name">failUnlessEqual<span class="args">(self, first, second, msg=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail if the two objects are unequal as determined by the '=='
77
</div></div><div class="method section inherited"><span class="method name">failUnlessRaises<span class="args">(self, excClass, callableObj, *args, **kwargs)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Fail unless an exception of class excClass is thrown
78
by callableObj when invoked with arguments args and keyword
79
arguments kwargs. If a different type of exception is
80
thrown, it will not be caught, and the test case will be
81
deemed to have suffered an error, exactly as for an
82
unexpected exception.</p>
83
</div></div><div class="method section inherited"><span class="method name">id<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"></div></div><div class="method section inherited"><span class="method name">run<span class="args">(self, result=None)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"></div></div><div class="method section"><span class="method name">runTest<span class="args">(self)</span></span><div class="method doc"></div></div><div class="method section inherited"><span class="method name">setUp<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Hook method for setting up the test fixture before exercising it.</p>
84
</div></div><div class="method section inherited"><span class="method name">shortDescription<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Returns a one-line description of the test, or None if no
85
description has been provided.</p>
86
<p>The default implementation of this method returns the first line of
87
the specified test method's docstring.</p>
88
</div></div><div class="method section inherited"><span class="method name">tearDown<span class="args">(self)</span></span><span class="method inherited">(inherited from TestCase)</span><div class="method doc"><p>Hook method for deconstructing the test fixture after testing it.</p>
89
</div></div></div></div>
92
<script src="http://www.google-analytics.com/urchin.js"
93
type="text/javascript">
95
<script type="text/javascript">
96
_uacct = "UA-2236166-1";