1 <?xml version="1.0" encoding="ascii"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <title>lxml.doctestcompare.LXMLOutputChecker</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
11 <body bgcolor="white" text="black" link="blue" vlink="#204080"
13 <!-- ==================== NAVIGATION BAR ==================== -->
14 <table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
18 <th> <a
19 href="lxml-module.html">Home</a> </th>
22 <th> <a
23 href="module-tree.html">Trees</a> </th>
26 <th> <a
27 href="identifier-index.html">Indices</a> </th>
30 <th> <a
31 href="help.html">Help</a> </th>
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="/">lxml API</a></th>
41 <table width="100%" cellpadding="0" cellspacing="0">
44 <span class="breadcrumbs">
45 <a href="lxml-module.html">Package lxml</a> ::
46 <a href="lxml.doctestcompare-module.html">Module doctestcompare</a> ::
47 Class LXMLOutputChecker
51 <table cellpadding="0" cellspacing="0">
52 <!-- hide/show private -->
53 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
54 onclick="toggle_private();">hide private</a>]</span></td></tr>
55 <tr><td align="right"><span class="options"
56 >[<a href="frames.html" target="_top">frames</a
57 >] | <a href="lxml.doctestcompare.LXMLOutputChecker-class.html"
58 target="_top">no frames</a>]</span></td></tr>
63 <!-- ==================== CLASS DESCRIPTION ==================== -->
64 <h1 class="epydoc">Class LXMLOutputChecker</h1><p class="nomargin-top"><span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker">source code</a></span></p>
65 <pre class="base-tree">
66 doctest.OutputChecker --+
68 <strong class="uidshort">LXMLOutputChecker</strong>
71 <dl><dt>Known Subclasses:</dt>
73 <ul class="subclass-list">
74 <li><a href="lxml.doctestcompare.LHTMLOutputChecker-class.html">LHTMLOutputChecker</a></li> </ul>
78 <!-- ==================== INSTANCE METHODS ==================== -->
79 <a name="section-InstanceMethods"></a>
80 <table class="summary" border="1" cellpadding="3"
81 cellspacing="0" width="100%" bgcolor="white">
82 <tr bgcolor="#70b0f0" class="table-header">
83 <td colspan="2" class="table-header">
84 <table border="0" cellpadding="0" cellspacing="0" width="100%">
86 <td align="left"><span class="table-header">Instance Methods</span></td>
87 <td align="right" valign="top"
88 ><span class="options">[<a href="#section-InstanceMethods"
89 class="privatelink" onclick="toggle_private();"
90 >hide private</a>]</span></td>
96 <td width="15%" align="right" valign="top" class="summary">
97 <span class="summary-type"> </span>
98 </td><td class="summary">
99 <table width="100%" cellpadding="0" cellspacing="0" border="0">
101 <td><span class="summary-sig"><a name="get_default_parser"></a><span class="summary-sig-name">get_default_parser</span>(<span class="summary-sig-arg">self</span>)</span></td>
102 <td align="right" valign="top">
103 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.get_default_parser">source code</a></span>
112 <td width="15%" align="right" valign="top" class="summary">
113 <span class="summary-type"> </span>
114 </td><td class="summary">
115 <table width="100%" cellpadding="0" cellspacing="0" border="0">
117 <td><span class="summary-sig"><a href="lxml.doctestcompare.LXMLOutputChecker-class.html#check_output" class="summary-sig-name">check_output</a>(<span class="summary-sig-arg">self</span>,
118 <span class="summary-sig-arg">want</span>,
119 <span class="summary-sig-arg">got</span>,
120 <span class="summary-sig-arg">optionflags</span>)</span><br />
121 Return True iff the actual output from an example (<code class="link">got</code>)
122 matches the expected output (<code class="link">want</code>). These strings are
123 always considered to match if they are identical; but
124 depending on what option flags the test runner is using,
125 several non-exact match types are also possible. See the
126 documentation for <code class="link">TestRunner</code> for more information about
128 <td align="right" valign="top">
129 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.check_output">source code</a></span>
138 <td width="15%" align="right" valign="top" class="summary">
139 <span class="summary-type"> </span>
140 </td><td class="summary">
141 <table width="100%" cellpadding="0" cellspacing="0" border="0">
143 <td><span class="summary-sig"><a name="get_parser"></a><span class="summary-sig-name">get_parser</span>(<span class="summary-sig-arg">self</span>,
144 <span class="summary-sig-arg">want</span>,
145 <span class="summary-sig-arg">got</span>,
146 <span class="summary-sig-arg">optionflags</span>)</span></td>
147 <td align="right" valign="top">
148 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.get_parser">source code</a></span>
157 <td width="15%" align="right" valign="top" class="summary">
158 <span class="summary-type"> </span>
159 </td><td class="summary">
160 <table width="100%" cellpadding="0" cellspacing="0" border="0">
162 <td><span class="summary-sig"><a name="_looks_like_markup"></a><span class="summary-sig-name">_looks_like_markup</span>(<span class="summary-sig-arg">self</span>,
163 <span class="summary-sig-arg">s</span>)</span></td>
164 <td align="right" valign="top">
165 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker._looks_like_markup">source code</a></span>
174 <td width="15%" align="right" valign="top" class="summary">
175 <span class="summary-type"> </span>
176 </td><td class="summary">
177 <table width="100%" cellpadding="0" cellspacing="0" border="0">
179 <td><span class="summary-sig"><a name="compare_docs"></a><span class="summary-sig-name">compare_docs</span>(<span class="summary-sig-arg">self</span>,
180 <span class="summary-sig-arg">want</span>,
181 <span class="summary-sig-arg">got</span>)</span></td>
182 <td align="right" valign="top">
183 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.compare_docs">source code</a></span>
192 <td width="15%" align="right" valign="top" class="summary">
193 <span class="summary-type"> </span>
194 </td><td class="summary">
195 <table width="100%" cellpadding="0" cellspacing="0" border="0">
197 <td><span class="summary-sig"><a name="text_compare"></a><span class="summary-sig-name">text_compare</span>(<span class="summary-sig-arg">self</span>,
198 <span class="summary-sig-arg">want</span>,
199 <span class="summary-sig-arg">got</span>,
200 <span class="summary-sig-arg">strip</span>)</span></td>
201 <td align="right" valign="top">
202 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.text_compare">source code</a></span>
211 <td width="15%" align="right" valign="top" class="summary">
212 <span class="summary-type"> </span>
213 </td><td class="summary">
214 <table width="100%" cellpadding="0" cellspacing="0" border="0">
216 <td><span class="summary-sig"><a name="tag_compare"></a><span class="summary-sig-name">tag_compare</span>(<span class="summary-sig-arg">self</span>,
217 <span class="summary-sig-arg">want</span>,
218 <span class="summary-sig-arg">got</span>)</span></td>
219 <td align="right" valign="top">
220 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.tag_compare">source code</a></span>
229 <td width="15%" align="right" valign="top" class="summary">
230 <span class="summary-type"> </span>
231 </td><td class="summary">
232 <table width="100%" cellpadding="0" cellspacing="0" border="0">
234 <td><span class="summary-sig"><a href="lxml.doctestcompare.LXMLOutputChecker-class.html#output_difference" class="summary-sig-name">output_difference</a>(<span class="summary-sig-arg">self</span>,
235 <span class="summary-sig-arg">example</span>,
236 <span class="summary-sig-arg">got</span>,
237 <span class="summary-sig-arg">optionflags</span>)</span><br />
238 Return a string describing the differences between the
239 expected output for a given example (<code class="link">example</code>) and the actual
240 output (<code class="link">got</code>). <code class="link">optionflags</code> is the set of option flags used
241 to compare <code class="link">want</code> and <code class="link">got</code>.</td>
242 <td align="right" valign="top">
243 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.output_difference">source code</a></span>
252 <td width="15%" align="right" valign="top" class="summary">
253 <span class="summary-type"> </span>
254 </td><td class="summary">
255 <table width="100%" cellpadding="0" cellspacing="0" border="0">
257 <td><span class="summary-sig"><a name="html_empty_tag"></a><span class="summary-sig-name">html_empty_tag</span>(<span class="summary-sig-arg">self</span>,
258 <span class="summary-sig-arg">el</span>,
259 <span class="summary-sig-arg">html</span>=<span class="summary-sig-default">True</span>)</span></td>
260 <td align="right" valign="top">
261 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.html_empty_tag">source code</a></span>
270 <td width="15%" align="right" valign="top" class="summary">
271 <span class="summary-type"> </span>
272 </td><td class="summary">
273 <table width="100%" cellpadding="0" cellspacing="0" border="0">
275 <td><span class="summary-sig"><a name="format_doc"></a><span class="summary-sig-name">format_doc</span>(<span class="summary-sig-arg">self</span>,
276 <span class="summary-sig-arg">doc</span>,
277 <span class="summary-sig-arg">html</span>,
278 <span class="summary-sig-arg">indent</span>,
279 <span class="summary-sig-arg">prefix</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span></td>
280 <td align="right" valign="top">
281 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.format_doc">source code</a></span>
290 <td width="15%" align="right" valign="top" class="summary">
291 <span class="summary-type"> </span>
292 </td><td class="summary">
293 <table width="100%" cellpadding="0" cellspacing="0" border="0">
295 <td><span class="summary-sig"><a name="format_text"></a><span class="summary-sig-name">format_text</span>(<span class="summary-sig-arg">self</span>,
296 <span class="summary-sig-arg">text</span>,
297 <span class="summary-sig-arg">strip</span>=<span class="summary-sig-default">True</span>)</span></td>
298 <td align="right" valign="top">
299 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.format_text">source code</a></span>
308 <td width="15%" align="right" valign="top" class="summary">
309 <span class="summary-type"> </span>
310 </td><td class="summary">
311 <table width="100%" cellpadding="0" cellspacing="0" border="0">
313 <td><span class="summary-sig"><a name="format_tag"></a><span class="summary-sig-name">format_tag</span>(<span class="summary-sig-arg">self</span>,
314 <span class="summary-sig-arg">el</span>)</span></td>
315 <td align="right" valign="top">
316 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.format_tag">source code</a></span>
325 <td width="15%" align="right" valign="top" class="summary">
326 <span class="summary-type"> </span>
327 </td><td class="summary">
328 <table width="100%" cellpadding="0" cellspacing="0" border="0">
330 <td><span class="summary-sig"><a name="format_end_tag"></a><span class="summary-sig-name">format_end_tag</span>(<span class="summary-sig-arg">self</span>,
331 <span class="summary-sig-arg">el</span>)</span></td>
332 <td align="right" valign="top">
333 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.format_end_tag">source code</a></span>
342 <td width="15%" align="right" valign="top" class="summary">
343 <span class="summary-type"> </span>
344 </td><td class="summary">
345 <table width="100%" cellpadding="0" cellspacing="0" border="0">
347 <td><span class="summary-sig"><a name="collect_diff"></a><span class="summary-sig-name">collect_diff</span>(<span class="summary-sig-arg">self</span>,
348 <span class="summary-sig-arg">want</span>,
349 <span class="summary-sig-arg">got</span>,
350 <span class="summary-sig-arg">html</span>,
351 <span class="summary-sig-arg">indent</span>)</span></td>
352 <td align="right" valign="top">
353 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.collect_diff">source code</a></span>
362 <td width="15%" align="right" valign="top" class="summary">
363 <span class="summary-type"> </span>
364 </td><td class="summary">
365 <table width="100%" cellpadding="0" cellspacing="0" border="0">
367 <td><span class="summary-sig"><a name="collect_diff_tag"></a><span class="summary-sig-name">collect_diff_tag</span>(<span class="summary-sig-arg">self</span>,
368 <span class="summary-sig-arg">want</span>,
369 <span class="summary-sig-arg">got</span>)</span></td>
370 <td align="right" valign="top">
371 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.collect_diff_tag">source code</a></span>
380 <td width="15%" align="right" valign="top" class="summary">
381 <span class="summary-type"> </span>
382 </td><td class="summary">
383 <table width="100%" cellpadding="0" cellspacing="0" border="0">
385 <td><span class="summary-sig"><a name="collect_diff_end_tag"></a><span class="summary-sig-name">collect_diff_end_tag</span>(<span class="summary-sig-arg">self</span>,
386 <span class="summary-sig-arg">want</span>,
387 <span class="summary-sig-arg">got</span>)</span></td>
388 <td align="right" valign="top">
389 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.collect_diff_end_tag">source code</a></span>
398 <td width="15%" align="right" valign="top" class="summary">
399 <span class="summary-type"> </span>
400 </td><td class="summary">
401 <table width="100%" cellpadding="0" cellspacing="0" border="0">
403 <td><span class="summary-sig"><a name="collect_diff_text"></a><span class="summary-sig-name">collect_diff_text</span>(<span class="summary-sig-arg">self</span>,
404 <span class="summary-sig-arg">want</span>,
405 <span class="summary-sig-arg">got</span>,
406 <span class="summary-sig-arg">strip</span>=<span class="summary-sig-default">True</span>)</span></td>
407 <td align="right" valign="top">
408 <span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.collect_diff_text">source code</a></span>
417 <td colspan="2" class="summary">
418 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code>doctest.OutputChecker</code></b> (private):
419 <code>_do_a_fancy_diff</code>
424 <!-- ==================== CLASS VARIABLES ==================== -->
425 <a name="section-ClassVariables"></a>
426 <table class="summary" border="1" cellpadding="3"
427 cellspacing="0" width="100%" bgcolor="white">
428 <tr bgcolor="#70b0f0" class="table-header">
429 <td colspan="2" class="table-header">
430 <table border="0" cellpadding="0" cellspacing="0" width="100%">
432 <td align="left"><span class="table-header">Class Variables</span></td>
433 <td align="right" valign="top"
434 ><span class="options">[<a href="#section-ClassVariables"
435 class="privatelink" onclick="toggle_private();"
436 >hide private</a>]</span></td>
442 <td width="15%" align="right" valign="top" class="summary">
443 <span class="summary-type"> </span>
444 </td><td class="summary">
445 <a href="lxml.doctestcompare.LXMLOutputChecker-class.html#empty_tags" class="summary-name">empty_tags</a> = <code title="('param',
453 ..."><code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">param</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">img</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">area</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">br</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">basefont</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">input</code><code class="variable-ellipsis">...</code></code>
457 <!-- ==================== METHOD DETAILS ==================== -->
458 <a name="section-MethodDetails"></a>
459 <table class="details" border="1" cellpadding="3"
460 cellspacing="0" width="100%" bgcolor="white">
461 <tr bgcolor="#70b0f0" class="table-header">
462 <td colspan="2" class="table-header">
463 <table border="0" cellpadding="0" cellspacing="0" width="100%">
465 <td align="left"><span class="table-header">Method Details</span></td>
466 <td align="right" valign="top"
467 ><span class="options">[<a href="#section-MethodDetails"
468 class="privatelink" onclick="toggle_private();"
469 >hide private</a>]</span></td>
475 <a name="check_output"></a>
477 <table class="details" border="1" cellpadding="3"
478 cellspacing="0" width="100%" bgcolor="white">
480 <table width="100%" cellpadding="0" cellspacing="0" border="0">
481 <tr valign="top"><td>
482 <h3 class="epydoc"><span class="sig"><span class="sig-name">check_output</span>(<span class="sig-arg">self</span>,
483 <span class="sig-arg">want</span>,
484 <span class="sig-arg">got</span>,
485 <span class="sig-arg">optionflags</span>)</span>
487 </td><td align="right" valign="top"
488 ><span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.check_output">source code</a></span>
492 Return True iff the actual output from an example (<code class="link">got</code>)
493 matches the expected output (<code class="link">want</code>). These strings are
494 always considered to match if they are identical; but
495 depending on what option flags the test runner is using,
496 several non-exact match types are also possible. See the
497 documentation for <code class="link">TestRunner</code> for more information about
501 doctest.OutputChecker.check_output
502 <dd><em class="note">(inherited documentation)</em></dd>
507 <a name="output_difference"></a>
509 <table class="details" border="1" cellpadding="3"
510 cellspacing="0" width="100%" bgcolor="white">
512 <table width="100%" cellpadding="0" cellspacing="0" border="0">
513 <tr valign="top"><td>
514 <h3 class="epydoc"><span class="sig"><span class="sig-name">output_difference</span>(<span class="sig-arg">self</span>,
515 <span class="sig-arg">example</span>,
516 <span class="sig-arg">got</span>,
517 <span class="sig-arg">optionflags</span>)</span>
519 </td><td align="right" valign="top"
520 ><span class="codelink"><a href="lxml.doctestcompare-pysrc.html#LXMLOutputChecker.output_difference">source code</a></span>
524 Return a string describing the differences between the
525 expected output for a given example (<code class="link">example</code>) and the actual
526 output (<code class="link">got</code>). <code class="link">optionflags</code> is the set of option flags used
527 to compare <code class="link">want</code> and <code class="link">got</code>.
530 doctest.OutputChecker.output_difference
531 <dd><em class="note">(inherited documentation)</em></dd>
537 <!-- ==================== CLASS VARIABLE DETAILS ==================== -->
538 <a name="section-ClassVariableDetails"></a>
539 <table class="details" border="1" cellpadding="3"
540 cellspacing="0" width="100%" bgcolor="white">
541 <tr bgcolor="#70b0f0" class="table-header">
542 <td colspan="2" class="table-header">
543 <table border="0" cellpadding="0" cellspacing="0" width="100%">
545 <td align="left"><span class="table-header">Class Variable Details</span></td>
546 <td align="right" valign="top"
547 ><span class="options">[<a href="#section-ClassVariableDetails"
548 class="privatelink" onclick="toggle_private();"
549 >hide private</a>]</span></td>
555 <a name="empty_tags"></a>
557 <table class="details" border="1" cellpadding="3"
558 cellspacing="0" width="100%" bgcolor="white">
560 <h3 class="epydoc">empty_tags</h3>
566 <dd><table><tr><td><pre class="variable">
567 <code class="variable-group">(</code><code class="variable-quote">'</code><code class="variable-string">param</code><code class="variable-quote">'</code><code class="variable-op">,</code>
568 <code class="variable-quote">'</code><code class="variable-string">img</code><code class="variable-quote">'</code><code class="variable-op">,</code>
569 <code class="variable-quote">'</code><code class="variable-string">area</code><code class="variable-quote">'</code><code class="variable-op">,</code>
570 <code class="variable-quote">'</code><code class="variable-string">br</code><code class="variable-quote">'</code><code class="variable-op">,</code>
571 <code class="variable-quote">'</code><code class="variable-string">basefont</code><code class="variable-quote">'</code><code class="variable-op">,</code>
572 <code class="variable-quote">'</code><code class="variable-string">input</code><code class="variable-quote">'</code><code class="variable-op">,</code>
573 <code class="variable-quote">'</code><code class="variable-string">base</code><code class="variable-quote">'</code><code class="variable-op">,</code>
574 <code class="variable-quote">'</code><code class="variable-string">meta</code><code class="variable-quote">'</code><code class="variable-op">,</code>
575 <code class="variable-ellipsis">...</code>
576 </pre></td></tr></table>
582 <!-- ==================== NAVIGATION BAR ==================== -->
583 <table class="navbar" border="0" width="100%" cellpadding="0"
584 bgcolor="#a0c0ff" cellspacing="0">
587 <th> <a
588 href="lxml-module.html">Home</a> </th>
591 <th> <a
592 href="module-tree.html">Trees</a> </th>
595 <th> <a
596 href="identifier-index.html">Indices</a> </th>
599 <th> <a
600 href="help.html">Help</a> </th>
602 <!-- Project homepage -->
603 <th class="navbar" align="right" width="100%">
604 <table border="0" cellpadding="0" cellspacing="0">
605 <tr><th class="navbar" align="center"
606 ><a class="navbar" target="_top" href="/">lxml API</a></th>
610 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
612 <td align="left" class="footer">
613 Generated by Epydoc 3.0.1
614 on Wed Jan 29 12:26:21 2020
616 <td align="right" class="footer">
617 <a target="mainFrame" href="http://epydoc.sourceforge.net"
618 >http://epydoc.sourceforge.net</a>
623 <script type="text/javascript">
625 // Private objects are initially displayed (because if
626 // javascript is turned off then we want them to be
627 // visible); but by default, we want to hide them. So hide
628 // them unless we have a cookie that says to show them.