This file is indexed.

/usr/share/doc/python-pytest-doc/html/example/reportingdemo.html is in python-pytest-doc 2.8.7-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Demo of Python failure reports with pytest</title>
    
    <link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.8.7',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/pytest1favi.ico"/>
    <link rel="top" title="None" href="../contents.html" />
    <link rel="up" title="Usages and Examples" href="index.html" />
    <link rel="next" title="Basic patterns and examples" href="simple.html" />
    <link rel="prev" title="Usages and Examples" href="index.html" />
   
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">

  </head>
  <body role="document">
  
  

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="simple.html" title="Basic patterns and examples"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="index.html" title="Usages and Examples"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../contents.html">pytest-2.8.7</a> &raquo;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Usages and Examples</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="demo-of-python-failure-reports-with-pytest">
<span id="tbreportdemo"></span><h1>Demo of Python failure reports with pytest<a class="headerlink" href="#demo-of-python-failure-reports-with-pytest" title="Permalink to this headline">ΒΆ</a></h1>
<p>Here is a nice run of several tens of failures
and how <code class="docutils literal"><span class="pre">pytest</span></code> presents things (unfortunately
not showing the nice colors here in the HTML that you
get on the terminal - we are working on that):</p>
<div class="highlight-python"><div class="highlight"><pre>assertion $ py.test failure_demo.py
======= test session starts ========
platform linux -- Python 3.4.3, pytest-2.8.7, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR/assertion, inifile:
collected 42 items

failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

======= FAILURES ========
_______ test_generative[0] ________

param1 = 3, param2 = 6

    def test_generative(param1, param2):
&gt;       assert param1 * 2 &lt; param2
E       assert (3 * 2) &lt; 6

failure_demo.py:15: AssertionError
_______ TestFailing.test_simple ________

self = &lt;failure_demo.TestFailing object at 0xdeadbeef&gt;

    def test_simple(self):
        def f():
            return 42
        def g():
            return 43

&gt;       assert f() == g()
E       assert 42 == 43
E        +  where 42 = &lt;function TestFailing.test_simple.&lt;locals&gt;.f at 0xdeadbeef&gt;()
E        +  and   43 = &lt;function TestFailing.test_simple.&lt;locals&gt;.g at 0xdeadbeef&gt;()

failure_demo.py:28: AssertionError
_______ TestFailing.test_simple_multiline ________

self = &lt;failure_demo.TestFailing object at 0xdeadbeef&gt;

    def test_simple_multiline(self):
        otherfunc_multi(
                  42,
&gt;                 6*9)

failure_demo.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = 42, b = 54

    def otherfunc_multi(a,b):
&gt;       assert (a ==
                b)
E       assert 42 == 54

failure_demo.py:11: AssertionError
_______ TestFailing.test_not ________

self = &lt;failure_demo.TestFailing object at 0xdeadbeef&gt;

    def test_not(self):
        def f():
            return 42
&gt;       assert not f()
E       assert not 42
E        +  where 42 = &lt;function TestFailing.test_not.&lt;locals&gt;.f at 0xdeadbeef&gt;()

failure_demo.py:38: AssertionError
_______ TestSpecialisedExplanations.test_eq_text ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_text(self):
&gt;       assert &#39;spam&#39; == &#39;eggs&#39;
E       assert &#39;spam&#39; == &#39;eggs&#39;
E         - spam
E         + eggs

failure_demo.py:42: AssertionError
_______ TestSpecialisedExplanations.test_eq_similar_text ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_similar_text(self):
&gt;       assert &#39;foo 1 bar&#39; == &#39;foo 2 bar&#39;
E       assert &#39;foo 1 bar&#39; == &#39;foo 2 bar&#39;
E         - foo 1 bar
E         ?     ^
E         + foo 2 bar
E         ?     ^

failure_demo.py:45: AssertionError
_______ TestSpecialisedExplanations.test_eq_multiline_text ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_multiline_text(self):
&gt;       assert &#39;foo\nspam\nbar&#39; == &#39;foo\neggs\nbar&#39;
E       assert &#39;foo\nspam\nbar&#39; == &#39;foo\neggs\nbar&#39;
E           foo
E         - spam
E         + eggs
E           bar

failure_demo.py:48: AssertionError
_______ TestSpecialisedExplanations.test_eq_long_text ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_long_text(self):
        a = &#39;1&#39;*100 + &#39;a&#39; + &#39;2&#39;*100
        b = &#39;1&#39;*100 + &#39;b&#39; + &#39;2&#39;*100
&gt;       assert a == b
E       assert &#39;111111111111...2222222222222&#39; == &#39;1111111111111...2222222222222&#39;
E         Skipping 90 identical leading characters in diff, use -v to show
E         Skipping 91 identical trailing characters in diff, use -v to show
E         - 1111111111a222222222
E         ?           ^
E         + 1111111111b222222222
E         ?           ^

failure_demo.py:53: AssertionError
_______ TestSpecialisedExplanations.test_eq_long_text_multiline ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_long_text_multiline(self):
        a = &#39;1\n&#39;*100 + &#39;a&#39; + &#39;2\n&#39;*100
        b = &#39;1\n&#39;*100 + &#39;b&#39; + &#39;2\n&#39;*100
&gt;       assert a == b
E       assert &#39;1\n1\n1\n1\n...n2\n2\n2\n2\n&#39; == &#39;1\n1\n1\n1\n1...n2\n2\n2\n2\n&#39;
E         Skipping 190 identical leading characters in diff, use -v to show
E         Skipping 191 identical trailing characters in diff, use -v to show
E           1
E           1
E           1
E           1
E           1
E         - a2
E         + b2
E           2
E           2
E           2
E           2

failure_demo.py:58: AssertionError
_______ TestSpecialisedExplanations.test_eq_list ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_list(self):
&gt;       assert [0, 1, 2] == [0, 1, 3]
E       assert [0, 1, 2] == [0, 1, 3]
E         At index 2 diff: 2 != 3
E         Use -v to get the full diff

failure_demo.py:61: AssertionError
_______ TestSpecialisedExplanations.test_eq_list_long ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_list_long(self):
        a = [0]*100 + [1] + [3]*100
        b = [0]*100 + [2] + [3]*100
&gt;       assert a == b
E       assert [0, 0, 0, 0, 0, 0, ...] == [0, 0, 0, 0, 0, 0, ...]
E         At index 100 diff: 1 != 2
E         Use -v to get the full diff

failure_demo.py:66: AssertionError
_______ TestSpecialisedExplanations.test_eq_dict ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_dict(self):
&gt;       assert {&#39;a&#39;: 0, &#39;b&#39;: 1, &#39;c&#39;: 0} == {&#39;a&#39;: 0, &#39;b&#39;: 2, &#39;d&#39;: 0}
E       assert {&#39;a&#39;: 0, &#39;b&#39;: 1, &#39;c&#39;: 0} == {&#39;a&#39;: 0, &#39;b&#39;: 2, &#39;d&#39;: 0}
E         Omitting 1 identical items, use -v to show
E         Differing items:
E         {&#39;b&#39;: 1} != {&#39;b&#39;: 2}
E         Left contains more items:
E         {&#39;c&#39;: 0}
E         Right contains more items:
E         {&#39;d&#39;: 0}
E         Use -v to get the full diff

failure_demo.py:69: AssertionError
_______ TestSpecialisedExplanations.test_eq_set ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_set(self):
&gt;       assert set([0, 10, 11, 12]) == set([0, 20, 21])
E       assert set([0, 10, 11, 12]) == set([0, 20, 21])
E         Extra items in the left set:
E         10
E         11
E         12
E         Extra items in the right set:
E         20
E         21
E         Use -v to get the full diff

failure_demo.py:72: AssertionError
_______ TestSpecialisedExplanations.test_eq_longer_list ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_eq_longer_list(self):
&gt;       assert [1,2] == [1,2,3]
E       assert [1, 2] == [1, 2, 3]
E         Right contains more items, first extra item: 3
E         Use -v to get the full diff

failure_demo.py:75: AssertionError
_______ TestSpecialisedExplanations.test_in_list ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_in_list(self):
&gt;       assert 1 in [0, 2, 3, 4, 5]
E       assert 1 in [0, 2, 3, 4, 5]

failure_demo.py:78: AssertionError
_______ TestSpecialisedExplanations.test_not_in_text_multiline ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_not_in_text_multiline(self):
        text = &#39;some multiline\ntext\nwhich\nincludes foo\nand a\ntail&#39;
&gt;       assert &#39;foo&#39; not in text
E       assert &#39;foo&#39; not in &#39;some multiline\ntext\nw...ncludes foo\nand a\ntail&#39;
E         &#39;foo&#39; is contained here:
E           some multiline
E           text
E           which
E           includes foo
E         ?          +++
E           and a
E           tail

failure_demo.py:82: AssertionError
_______ TestSpecialisedExplanations.test_not_in_text_single ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_not_in_text_single(self):
        text = &#39;single foo line&#39;
&gt;       assert &#39;foo&#39; not in text
E       assert &#39;foo&#39; not in &#39;single foo line&#39;
E         &#39;foo&#39; is contained here:
E           single foo line
E         ?        +++

failure_demo.py:86: AssertionError
_______ TestSpecialisedExplanations.test_not_in_text_single_long ________

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_not_in_text_single_long(self):
        text = &#39;head &#39; * 50 + &#39;foo &#39; + &#39;tail &#39; * 20
&gt;       assert &#39;foo&#39; not in text
E       assert &#39;foo&#39; not in &#39;head head head head hea...ail tail tail tail tail &#39;
E         &#39;foo&#39; is contained here:
E           head head foo tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail
E         ?           +++

failure_demo.py:90: AssertionError
______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______

self = &lt;failure_demo.TestSpecialisedExplanations object at 0xdeadbeef&gt;

    def test_not_in_text_single_long_term(self):
        text = &#39;head &#39; * 50 + &#39;f&#39;*70 + &#39;tail &#39; * 20
&gt;       assert &#39;f&#39;*70 not in text
E       assert &#39;fffffffffff...ffffffffffff&#39; not in &#39;head head he...l tail tail &#39;
E         &#39;ffffffffffffffffff...fffffffffffffffffff&#39; is contained here:
E           head head fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffftail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail
E         ?           ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

failure_demo.py:94: AssertionError
_______ test_attribute ________

    def test_attribute():
        class Foo(object):
            b = 1
        i = Foo()
&gt;       assert i.b == 2
E       assert 1 == 2
E        +  where 1 = &lt;failure_demo.test_attribute.&lt;locals&gt;.Foo object at 0xdeadbeef&gt;.b

failure_demo.py:101: AssertionError
_______ test_attribute_instance ________

    def test_attribute_instance():
        class Foo(object):
            b = 1
&gt;       assert Foo().b == 2
E       assert 1 == 2
E        +  where 1 = &lt;failure_demo.test_attribute_instance.&lt;locals&gt;.Foo object at 0xdeadbeef&gt;.b
E        +    where &lt;failure_demo.test_attribute_instance.&lt;locals&gt;.Foo object at 0xdeadbeef&gt; = &lt;class &#39;failure_demo.test_attribute_instance.&lt;locals&gt;.Foo&#39;&gt;()

failure_demo.py:107: AssertionError
_______ test_attribute_failure ________

    def test_attribute_failure():
        class Foo(object):
            def _get_b(self):
                raise Exception(&#39;Failed to get attrib&#39;)
            b = property(_get_b)
        i = Foo()
&gt;       assert i.b == 2

failure_demo.py:116:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;failure_demo.test_attribute_failure.&lt;locals&gt;.Foo object at 0xdeadbeef&gt;

    def _get_b(self):
&gt;       raise Exception(&#39;Failed to get attrib&#39;)
E       Exception: Failed to get attrib

failure_demo.py:113: Exception
_______ test_attribute_multiple ________

    def test_attribute_multiple():
        class Foo(object):
            b = 1
        class Bar(object):
            b = 2
&gt;       assert Foo().b == Bar().b
E       assert 1 == 2
E        +  where 1 = &lt;failure_demo.test_attribute_multiple.&lt;locals&gt;.Foo object at 0xdeadbeef&gt;.b
E        +    where &lt;failure_demo.test_attribute_multiple.&lt;locals&gt;.Foo object at 0xdeadbeef&gt; = &lt;class &#39;failure_demo.test_attribute_multiple.&lt;locals&gt;.Foo&#39;&gt;()
E        +  and   2 = &lt;failure_demo.test_attribute_multiple.&lt;locals&gt;.Bar object at 0xdeadbeef&gt;.b
E        +    where &lt;failure_demo.test_attribute_multiple.&lt;locals&gt;.Bar object at 0xdeadbeef&gt; = &lt;class &#39;failure_demo.test_attribute_multiple.&lt;locals&gt;.Bar&#39;&gt;()

failure_demo.py:124: AssertionError
_______ TestRaises.test_raises ________

self = &lt;failure_demo.TestRaises object at 0xdeadbeef&gt;

    def test_raises(self):
        s = &#39;qwe&#39;
&gt;       raises(TypeError, &quot;int(s)&quot;)

failure_demo.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

&gt;   int(s)
E   ValueError: invalid literal for int() with base 10: &#39;qwe&#39;

&lt;0-codegen $PYTHON_PREFIX/lib/python3.4/site-packages/_pytest/python.py:1300&gt;:1: ValueError
_______ TestRaises.test_raises_doesnt ________

self = &lt;failure_demo.TestRaises object at 0xdeadbeef&gt;

    def test_raises_doesnt(self):
&gt;       raises(IOError, &quot;int(&#39;3&#39;)&quot;)
E       Failed: DID NOT RAISE

failure_demo.py:136: Failed
_______ TestRaises.test_raise ________

self = &lt;failure_demo.TestRaises object at 0xdeadbeef&gt;

    def test_raise(self):
&gt;       raise ValueError(&quot;demo error&quot;)
E       ValueError: demo error

failure_demo.py:139: ValueError
_______ TestRaises.test_tupleerror ________

self = &lt;failure_demo.TestRaises object at 0xdeadbeef&gt;

    def test_tupleerror(self):
&gt;       a,b = [1]
E       ValueError: need more than 1 value to unpack

failure_demo.py:142: ValueError
______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______

self = &lt;failure_demo.TestRaises object at 0xdeadbeef&gt;

    def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
        l = [1,2,3]
        print (&quot;l is %r&quot; % l)
&gt;       a,b = l.pop()
E       TypeError: &#39;int&#39; object is not iterable

failure_demo.py:147: TypeError
--------------------------- Captured stdout call ---------------------------
l is [1, 2, 3]
_______ TestRaises.test_some_error ________

self = &lt;failure_demo.TestRaises object at 0xdeadbeef&gt;

    def test_some_error(self):
&gt;       if namenotexi:
E       NameError: name &#39;namenotexi&#39; is not defined

failure_demo.py:150: NameError
_______ test_dynamic_compile_shows_nicely ________

    def test_dynamic_compile_shows_nicely():
        src = &#39;def foo():\n assert 1 == 0\n&#39;
        name = &#39;abc-123&#39;
        module = py.std.imp.new_module(name)
        code = py.code.compile(src, name, &#39;exec&#39;)
        py.builtin.exec_(code, module.__dict__)
        py.std.sys.modules[name] = module
&gt;       module.foo()

failure_demo.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def foo():
&gt;    assert 1 == 0
E    assert 1 == 0

&lt;2-codegen &#39;abc-123&#39; $REGENDOC_TMPDIR/assertion/failure_demo.py:162&gt;:2: AssertionError
_______ TestMoreErrors.test_complex_error ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_complex_error(self):
        def f():
            return 44
        def g():
            return 43
&gt;       somefunc(f(), g())

failure_demo.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
failure_demo.py:8: in somefunc
    otherfunc(x,y)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = 44, b = 43

    def otherfunc(a,b):
&gt;       assert a==b
E       assert 44 == 43

failure_demo.py:5: AssertionError
_______ TestMoreErrors.test_z1_unpack_error ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_z1_unpack_error(self):
        l = []
&gt;       a,b  = l
E       ValueError: need more than 0 values to unpack

failure_demo.py:179: ValueError
_______ TestMoreErrors.test_z2_type_error ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_z2_type_error(self):
        l = 3
&gt;       a,b  = l
E       TypeError: &#39;int&#39; object is not iterable

failure_demo.py:183: TypeError
_______ TestMoreErrors.test_startswith ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_startswith(self):
        s = &quot;123&quot;
        g = &quot;456&quot;
&gt;       assert s.startswith(g)
E       assert &lt;built-in method startswith of str object at 0xdeadbeef&gt;(&#39;456&#39;)
E        +  where &lt;built-in method startswith of str object at 0xdeadbeef&gt; = &#39;123&#39;.startswith

failure_demo.py:188: AssertionError
_______ TestMoreErrors.test_startswith_nested ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_startswith_nested(self):
        def f():
            return &quot;123&quot;
        def g():
            return &quot;456&quot;
&gt;       assert f().startswith(g())
E       assert &lt;built-in method startswith of str object at 0xdeadbeef&gt;(&#39;456&#39;)
E        +  where &lt;built-in method startswith of str object at 0xdeadbeef&gt; = &#39;123&#39;.startswith
E        +    where &#39;123&#39; = &lt;function TestMoreErrors.test_startswith_nested.&lt;locals&gt;.f at 0xdeadbeef&gt;()
E        +  and   &#39;456&#39; = &lt;function TestMoreErrors.test_startswith_nested.&lt;locals&gt;.g at 0xdeadbeef&gt;()

failure_demo.py:195: AssertionError
_______ TestMoreErrors.test_global_func ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_global_func(self):
&gt;       assert isinstance(globf(42), float)
E       assert isinstance(43, float)
E        +  where 43 = globf(42)

failure_demo.py:198: AssertionError
_______ TestMoreErrors.test_instance ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_instance(self):
        self.x = 6*7
&gt;       assert self.x != 42
E       assert 42 != 42
E        +  where 42 = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;.x

failure_demo.py:202: AssertionError
_______ TestMoreErrors.test_compare ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_compare(self):
&gt;       assert globf(10) &lt; 5
E       assert 11 &lt; 5
E        +  where 11 = globf(10)

failure_demo.py:205: AssertionError
_______ TestMoreErrors.test_try_finally ________

self = &lt;failure_demo.TestMoreErrors object at 0xdeadbeef&gt;

    def test_try_finally(self):
        x = 1
        try:
&gt;           assert x == 0
E           assert 1 == 0

failure_demo.py:210: AssertionError
_______ TestCustomAssertMsg.test_single_line ________

self = &lt;failure_demo.TestCustomAssertMsg object at 0xdeadbeef&gt;

    def test_single_line(self):
        class A:
            a = 1
        b = 2
&gt;       assert A.a == b, &quot;A.a appears not to be b&quot;
E       AssertionError: A.a appears not to be b
E       assert 1 == 2
E        +  where 1 = &lt;class &#39;failure_demo.TestCustomAssertMsg.test_single_line.&lt;locals&gt;.A&#39;&gt;.a

failure_demo.py:221: AssertionError
_______ TestCustomAssertMsg.test_multiline ________

self = &lt;failure_demo.TestCustomAssertMsg object at 0xdeadbeef&gt;

    def test_multiline(self):
        class A:
            a = 1
        b = 2
&gt;       assert A.a == b, &quot;A.a appears not to be b\n&quot; \
            &quot;or does not appear to be b\none of those&quot;
E       AssertionError: A.a appears not to be b
E         or does not appear to be b
E         one of those
E       assert 1 == 2
E        +  where 1 = &lt;class &#39;failure_demo.TestCustomAssertMsg.test_multiline.&lt;locals&gt;.A&#39;&gt;.a

failure_demo.py:227: AssertionError
_______ TestCustomAssertMsg.test_custom_repr ________

self = &lt;failure_demo.TestCustomAssertMsg object at 0xdeadbeef&gt;

    def test_custom_repr(self):
        class JSON:
            a = 1
            def __repr__(self):
                return &quot;This is JSON\n{\n  &#39;foo&#39;: &#39;bar&#39;\n}&quot;
        a = JSON()
        b = 2
&gt;       assert a.a == b, a
E       AssertionError: This is JSON
E         {
E           &#39;foo&#39;: &#39;bar&#39;
E         }
E       assert 1 == 2
E        +  where 1 = This is JSON\n{\n  &#39;foo&#39;: &#39;bar&#39;\n}.a

failure_demo.py:237: AssertionError
======= 42 failed in 0.12 seconds ========
</pre></div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../contents.html">
              <img class="logo" src="../_static/pytest1.png" alt="Logo"/>
            </a></p><h3><a href="../contents.html">Table Of Contents</a></h3>

<ul>
  <li><a href="../index.html">Home</a></li>
  <li><a href="../contents.html">Contents</a></li>
  <li><a href="../getting-started.html">Install</a></li>
  <li><a href="index.html">Examples</a></li>
  <li><a href="../customize.html">Customize</a></li>
  <li><a href="../contact.html">Contact</a></li>
  <li><a href="../talks.html">Talks/Posts</a></li>
  <li><a href="../changelog.html">Changelog</a></li>
</ul><h3>Related Topics</h3>
<ul>
  <li><a href="../contents.html">Documentation overview</a><ul>
  <li><a href="index.html">Usages and Examples</a><ul>
      <li>Previous: <a href="index.html" title="previous chapter">Usages and Examples</a></li>
      <li>Next: <a href="simple.html" title="next chapter">Basic patterns and examples</a></li>
  </ul></li>
  </ul></li>
</ul><h3>Useful Links</h3>
<ul>
  <li><a href="../index.html">The pytest Website</a></li>
  <li><a href="../contributing.html">Contribution Guide</a></li>
  <li><a href="https://pypi.python.org/pypi/pytest">pytest @ PyPI</a></li>
  <li><a href="https://github.com/pytest-dev/pytest/">pytest @ GitHub</a></li>
  <li><a href="http://plugincompat.herokuapp.com/">3rd party plugins</a></li>
  <li><a href="https://github.com/pytest-dev/pytest/issues">Issue Tracker</a></li>
  <li><a href="http://pytest.org/latest/pytest.pdf">PDF Documentation</a>
</ul>

<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>

  <div class="footer">
    &copy; Copyright 2015, holger krekel and pytest-dev team.
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
  </div>
  

  </body>
</html>