File: reportingdemo.rst

package info (click to toggle)
pytest 8.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,992 kB
  • sloc: python: 62,771; makefile: 45
file content (724 lines) | stat: -rw-r--r-- 27,383 bytes parent folder | download
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
718
719
720
721
722
723
724
.. _`tbreportdemo`:

Demo of Python failure reports with pytest
==========================================

Here is a nice run of several failures and how ``pytest`` presents things:

.. code-block:: pytest

    assertion $ pytest failure_demo.py
    =========================== test session starts ============================
    platform linux -- Python 3.x.y, pytest-8.x.y, pluggy-1.x.y
    rootdir: /home/sweet/project/assertion
    collected 44 items

    failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF         [100%]

    ================================= FAILURES =================================
    ___________________________ test_generative[3-6] ___________________________

    param1 = 3, param2 = 6

        @pytest.mark.parametrize("param1, param2", [(3, 6)])
        def test_generative(param1, param2):
    >       assert param1 * 2 < param2
    E       assert (3 * 2) < 6

    failure_demo.py:21: AssertionError
    _________________________ TestFailing.test_simple __________________________

    self = <failure_demo.TestFailing object at 0xdeadbeef0001>

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

            def g():
                return 43

    >       assert f() == g()
    E       assert 42 == 43
    E        +  where 42 = <function TestFailing.test_simple.<locals>.f at 0xdeadbeef0002>()
    E        +  and   43 = <function TestFailing.test_simple.<locals>.g at 0xdeadbeef0003>()

    failure_demo.py:32: AssertionError
    ____________________ TestFailing.test_simple_multiline _____________________

    self = <failure_demo.TestFailing object at 0xdeadbeef0004>

        def test_simple_multiline(self):
    >       otherfunc_multi(42, 6 * 9)

    failure_demo.py:35:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    a = 42, b = 54

        def otherfunc_multi(a, b):
    >       assert a == b
    E       assert 42 == 54

    failure_demo.py:16: AssertionError
    ___________________________ TestFailing.test_not ___________________________

    self = <failure_demo.TestFailing object at 0xdeadbeef0005>

        def test_not(self):
            def f():
                return 42

    >       assert not f()
    E       assert not 42
    E        +  where 42 = <function TestFailing.test_not.<locals>.f at 0xdeadbeef0006>()

    failure_demo.py:41: AssertionError
    _________________ TestSpecialisedExplanations.test_eq_text _________________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0007>

        def test_eq_text(self):
    >       assert "spam" == "eggs"
    E       AssertionError: assert 'spam' == 'eggs'
    E
    E         - eggs
    E         + spam

    failure_demo.py:46: AssertionError
    _____________ TestSpecialisedExplanations.test_eq_similar_text _____________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0008>

        def test_eq_similar_text(self):
    >       assert "foo 1 bar" == "foo 2 bar"
    E       AssertionError: assert 'foo 1 bar' == 'foo 2 bar'
    E
    E         - foo 2 bar
    E         ?     ^
    E         + foo 1 bar
    E         ?     ^

    failure_demo.py:49: AssertionError
    ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0009>

        def test_eq_multiline_text(self):
    >       assert "foo\nspam\nbar" == "foo\neggs\nbar"
    E       AssertionError: assert 'foo\nspam\nbar' == 'foo\neggs\nbar'
    E
    E           foo
    E         - eggs
    E         + spam
    E           bar

    failure_demo.py:52: AssertionError
    ______________ TestSpecialisedExplanations.test_eq_long_text _______________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000a>

        def test_eq_long_text(self):
            a = "1" * 100 + "a" + "2" * 100
            b = "1" * 100 + "b" + "2" * 100
    >       assert a == b
    E       AssertionError: assert '111111111111...2222222222222' == '111111111111...2222222222222'
    E
    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         - 1111111111b222222222
    E         ?           ^
    E         + 1111111111a222222222
    E         ?           ^

    failure_demo.py:57: AssertionError
    _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000b>

        def test_eq_long_text_multiline(self):
            a = "1\n" * 100 + "a" + "2\n" * 100
            b = "1\n" * 100 + "b" + "2\n" * 100
    >       assert a == b
    E       AssertionError: assert '1\n1\n1\n1\n...n2\n2\n2\n2\n' == '1\n1\n1\n1\n...n2\n2\n2\n2\n'
    E
    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
    E         ...Full output truncated (7 lines hidden), use '-vv' to show

    failure_demo.py:62: AssertionError
    _________________ TestSpecialisedExplanations.test_eq_list _________________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000c>

        def test_eq_list(self):
    >       assert [0, 1, 2] == [0, 1, 3]
    E       assert [0, 1, 2] == [0, 1, 3]
    E
    E         At index 2 diff: 2 != 3
    E         Use -v to get more diff

    failure_demo.py:65: AssertionError
    ______________ TestSpecialisedExplanations.test_eq_list_long _______________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000d>

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

    failure_demo.py:70: AssertionError
    _________________ TestSpecialisedExplanations.test_eq_dict _________________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000e>

        def test_eq_dict(self):
    >       assert {"a": 0, "b": 1, "c": 0} == {"a": 0, "b": 2, "d": 0}
    E       AssertionError: assert {'a': 0, 'b': 1, 'c': 0} == {'a': 0, 'b': 2, 'd': 0}
    E
    E         Omitting 1 identical items, use -vv to show
    E         Differing items:
    E         {'b': 1} != {'b': 2}
    E         Left contains 1 more item:
    E         {'c': 0}
    E         Right contains 1 more item:
    E         {'d': 0}
    E         Use -v to get more diff

    failure_demo.py:73: AssertionError
    _________________ TestSpecialisedExplanations.test_eq_set __________________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000f>

        def test_eq_set(self):
    >       assert {0, 10, 11, 12} == {0, 20, 21}
    E       assert {0, 10, 11, 12} == {0, 20, 21}
    E
    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 more diff

    failure_demo.py:76: AssertionError
    _____________ TestSpecialisedExplanations.test_eq_longer_list ______________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0010>

        def test_eq_longer_list(self):
    >       assert [1, 2] == [1, 2, 3]
    E       assert [1, 2] == [1, 2, 3]
    E
    E         Right contains one more item: 3
    E         Use -v to get more diff

    failure_demo.py:79: AssertionError
    _________________ TestSpecialisedExplanations.test_in_list _________________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0011>

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

    failure_demo.py:82: AssertionError
    __________ TestSpecialisedExplanations.test_not_in_text_multiline __________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0012>

        def test_not_in_text_multiline(self):
            text = "some multiline\ntext\nwhich\nincludes foo\nand a\ntail"
    >       assert "foo" not in text
    E       AssertionError: assert 'foo' not in 'some multil...nand a\ntail'
    E
    E         'foo' is contained here:
    E           some multiline
    E           text
    E           which
    E           includes foo
    E         ?          +++
    E           and a
    E           tail

    failure_demo.py:86: AssertionError
    ___________ TestSpecialisedExplanations.test_not_in_text_single ____________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0013>

        def test_not_in_text_single(self):
            text = "single foo line"
    >       assert "foo" not in text
    E       AssertionError: assert 'foo' not in 'single foo line'
    E
    E         'foo' is contained here:
    E           single foo line
    E         ?        +++

    failure_demo.py:90: AssertionError
    _________ TestSpecialisedExplanations.test_not_in_text_single_long _________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0014>

        def test_not_in_text_single_long(self):
            text = "head " * 50 + "foo " + "tail " * 20
    >       assert "foo" not in text
    E       AssertionError: assert 'foo' not in 'head head h...l tail tail '
    E
    E         'foo' 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:94: AssertionError
    ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0015>

        def test_not_in_text_single_long_term(self):
            text = "head " * 50 + "f" * 70 + "tail " * 20
    >       assert "f" * 70 not in text
    E       AssertionError: assert 'fffffffffff...ffffffffffff' not in 'head head h...l tail tail '
    E
    E         'ffffffffffffffffff...fffffffffffffffffff' 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:98: AssertionError
    ______________ TestSpecialisedExplanations.test_eq_dataclass _______________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0016>

        def test_eq_dataclass(self):
            from dataclasses import dataclass

            @dataclass
            class Foo:
                a: int
                b: str

            left = Foo(1, "b")
            right = Foo(1, "c")
    >       assert left == right
    E       AssertionError: assert TestSpecialis...oo(a=1, b='b') == TestSpecialis...oo(a=1, b='c')
    E
    E         Omitting 1 identical items, use -vv to show
    E         Differing attributes:
    E         ['b']
    E
    E         Drill down into differing attribute b:
    E           b: 'b' != 'c'
    E           - c
    E           + b

    failure_demo.py:110: AssertionError
    ________________ TestSpecialisedExplanations.test_eq_attrs _________________

    self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0017>

        def test_eq_attrs(self):
            import attr

            @attr.s
            class Foo:
                a = attr.ib()
                b = attr.ib()

            left = Foo(1, "b")
            right = Foo(1, "c")
    >       assert left == right
    E       AssertionError: assert Foo(a=1, b='b') == Foo(a=1, b='c')
    E
    E         Omitting 1 identical items, use -vv to show
    E         Differing attributes:
    E         ['b']
    E
    E         Drill down into differing attribute b:
    E           b: 'b' != 'c'
    E           - c
    E           + b

    failure_demo.py:122: AssertionError
    ______________________________ test_attribute ______________________________

        def test_attribute():
            class Foo:
                b = 1

            i = Foo()
    >       assert i.b == 2
    E       assert 1 == 2
    E        +  where 1 = <failure_demo.test_attribute.<locals>.Foo object at 0xdeadbeef0018>.b

    failure_demo.py:130: AssertionError
    _________________________ test_attribute_instance __________________________

        def test_attribute_instance():
            class Foo:
                b = 1

    >       assert Foo().b == 2
    E       AssertionError: assert 1 == 2
    E        +  where 1 = <failure_demo.test_attribute_instance.<locals>.Foo object at 0xdeadbeef0019>.b
    E        +    where <failure_demo.test_attribute_instance.<locals>.Foo object at 0xdeadbeef0019> = <class 'failure_demo.test_attribute_instance.<locals>.Foo'>()

    failure_demo.py:137: AssertionError
    __________________________ test_attribute_failure __________________________

        def test_attribute_failure():
            class Foo:
                def _get_b(self):
                    raise Exception("Failed to get attrib")

                b = property(_get_b)

            i = Foo()
    >       assert i.b == 2
                   ^^^

    failure_demo.py:148:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <failure_demo.test_attribute_failure.<locals>.Foo object at 0xdeadbeef001a>

        def _get_b(self):
    >       raise Exception("Failed to get attrib")
    E       Exception: Failed to get attrib

    failure_demo.py:143: Exception
    _________________________ test_attribute_multiple __________________________

        def test_attribute_multiple():
            class Foo:
                b = 1

            class Bar:
                b = 2

    >       assert Foo().b == Bar().b
    E       AssertionError: assert 1 == 2
    E        +  where 1 = <failure_demo.test_attribute_multiple.<locals>.Foo object at 0xdeadbeef001b>.b
    E        +    where <failure_demo.test_attribute_multiple.<locals>.Foo object at 0xdeadbeef001b> = <class 'failure_demo.test_attribute_multiple.<locals>.Foo'>()
    E        +  and   2 = <failure_demo.test_attribute_multiple.<locals>.Bar object at 0xdeadbeef001c>.b
    E        +    where <failure_demo.test_attribute_multiple.<locals>.Bar object at 0xdeadbeef001c> = <class 'failure_demo.test_attribute_multiple.<locals>.Bar'>()

    failure_demo.py:158: AssertionError
    __________________________ TestRaises.test_raises __________________________

    self = <failure_demo.TestRaises object at 0xdeadbeef001d>

        def test_raises(self):
            s = "qwe"
    >       raises(TypeError, int, s)
    E       ValueError: invalid literal for int() with base 10: 'qwe'

    failure_demo.py:168: ValueError
    ______________________ TestRaises.test_raises_doesnt _______________________

    self = <failure_demo.TestRaises object at 0xdeadbeef001e>

        def test_raises_doesnt(self):
    >       raises(OSError, int, "3")
    E       Failed: DID NOT RAISE <class 'OSError'>

    failure_demo.py:171: Failed
    __________________________ TestRaises.test_raise ___________________________

    self = <failure_demo.TestRaises object at 0xdeadbeef001f>

        def test_raise(self):
    >       raise ValueError("demo error")
    E       ValueError: demo error

    failure_demo.py:174: ValueError
    ________________________ TestRaises.test_tupleerror ________________________

    self = <failure_demo.TestRaises object at 0xdeadbeef0020>

        def test_tupleerror(self):
    >       a, b = [1]  # noqa: F841
            ^^^^
    E       ValueError: not enough values to unpack (expected 2, got 1)

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

    self = <failure_demo.TestRaises object at 0xdeadbeef0021>

        def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
            items = [1, 2, 3]
            print(f"items is {items!r}")
    >       a, b = items.pop()
            ^^^^
    E       TypeError: cannot unpack non-iterable int object

    failure_demo.py:182: TypeError
    --------------------------- Captured stdout call ---------------------------
    items is [1, 2, 3]
    ________________________ TestRaises.test_some_error ________________________

    self = <failure_demo.TestRaises object at 0xdeadbeef0022>

        def test_some_error(self):
    >       if namenotexi:  # noqa: F821
               ^^^^^^^^^^
    E       NameError: name 'namenotexi' is not defined

    failure_demo.py:185: NameError
    ____________________ test_dynamic_compile_shows_nicely _____________________

        def test_dynamic_compile_shows_nicely():
            import importlib.util
            import sys

            src = "def foo():\n assert 1 == 0\n"
            name = "abc-123"
            spec = importlib.util.spec_from_loader(name, loader=None)
            module = importlib.util.module_from_spec(spec)
            code = compile(src, name, "exec")
            exec(code, module.__dict__)
            sys.modules[name] = module
    >       module.foo()

    failure_demo.py:204:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    >   ???
    E   AssertionError

    abc-123:2: AssertionError
    ____________________ TestMoreErrors.test_complex_error _____________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef0023>

        def test_complex_error(self):
            def f():
                return 44

            def g():
                return 43

    >       somefunc(f(), g())

    failure_demo.py:215:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    failure_demo.py:12: in somefunc
        otherfunc(x, y)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    a = 44, b = 43

        def otherfunc(a, b):
    >       assert a == b
    E       assert 44 == 43

    failure_demo.py:8: AssertionError
    ___________________ TestMoreErrors.test_z1_unpack_error ____________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef0024>

        def test_z1_unpack_error(self):
            items = []
    >       a, b = items
            ^^^^
    E       ValueError: not enough values to unpack (expected 2, got 0)

    failure_demo.py:219: ValueError
    ____________________ TestMoreErrors.test_z2_type_error _____________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef0025>

        def test_z2_type_error(self):
            items = 3
    >       a, b = items
            ^^^^
    E       TypeError: cannot unpack non-iterable int object

    failure_demo.py:223: TypeError
    ______________________ TestMoreErrors.test_startswith ______________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef0026>

        def test_startswith(self):
            s = "123"
            g = "456"
    >       assert s.startswith(g)
    E       AssertionError: assert False
    E        +  where False = <built-in method startswith of str object at 0xdeadbeef0027>('456')
    E        +    where <built-in method startswith of str object at 0xdeadbeef0027> = '123'.startswith

    failure_demo.py:228: AssertionError
    __________________ TestMoreErrors.test_startswith_nested ___________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef0028>

        def test_startswith_nested(self):
            def f():
                return "123"

            def g():
                return "456"

    >       assert f().startswith(g())
    E       AssertionError: assert False
    E        +  where False = <built-in method startswith of str object at 0xdeadbeef0027>('456')
    E        +    where <built-in method startswith of str object at 0xdeadbeef0027> = '123'.startswith
    E        +      where '123' = <function TestMoreErrors.test_startswith_nested.<locals>.f at 0xdeadbeef0029>()
    E        +    and   '456' = <function TestMoreErrors.test_startswith_nested.<locals>.g at 0xdeadbeef002a>()

    failure_demo.py:237: AssertionError
    _____________________ TestMoreErrors.test_global_func ______________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef002b>

        def test_global_func(self):
    >       assert isinstance(globf(42), float)
    E       assert False
    E        +  where False = isinstance(43, float)
    E        +    where 43 = globf(42)

    failure_demo.py:240: AssertionError
    _______________________ TestMoreErrors.test_instance _______________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef002c>

        def test_instance(self):
            self.x = 6 * 7
    >       assert self.x != 42
    E       assert 42 != 42
    E        +  where 42 = <failure_demo.TestMoreErrors object at 0xdeadbeef002c>.x

    failure_demo.py:244: AssertionError
    _______________________ TestMoreErrors.test_compare ________________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef002d>

        def test_compare(self):
    >       assert globf(10) < 5
    E       assert 11 < 5
    E        +  where 11 = globf(10)

    failure_demo.py:247: AssertionError
    _____________________ TestMoreErrors.test_try_finally ______________________

    self = <failure_demo.TestMoreErrors object at 0xdeadbeef002e>

        def test_try_finally(self):
            x = 1
            try:
    >           assert x == 0
    E           assert 1 == 0

    failure_demo.py:252: AssertionError
    ___________________ TestCustomAssertMsg.test_single_line ___________________

    self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef002f>

        def test_single_line(self):
            class A:
                a = 1

            b = 2
    >       assert A.a == b, "A.a appears not to be b"
    E       AssertionError: A.a appears not to be b
    E       assert 1 == 2
    E        +  where 1 = <class 'failure_demo.TestCustomAssertMsg.test_single_line.<locals>.A'>.a

    failure_demo.py:263: AssertionError
    ____________________ TestCustomAssertMsg.test_multiline ____________________

    self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef0030>

        def test_multiline(self):
            class A:
                a = 1

            b = 2
    >       assert A.a == b, (
                "A.a appears not to be b\nor does not appear to be b\none of those"
            )
    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 = <class 'failure_demo.TestCustomAssertMsg.test_multiline.<locals>.A'>.a

    failure_demo.py:270: AssertionError
    ___________________ TestCustomAssertMsg.test_custom_repr ___________________

    self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef0031>

        def test_custom_repr(self):
            class JSON:
                a = 1

                def __repr__(self):
                    return "This is JSON\n{\n  'foo': 'bar'\n}"

            a = JSON()
            b = 2
    >       assert a.a == b, a
    E       AssertionError: This is JSON
    E         {
    E           'foo': 'bar'
    E         }
    E       assert 1 == 2
    E        +  where 1 = This is JSON\n{\n  'foo': 'bar'\n}.a

    failure_demo.py:283: AssertionError
    ========================= short test summary info ==========================
    FAILED failure_demo.py::test_generative[3-6] - assert (3 * 2) < 6
    FAILED failure_demo.py::TestFailing::test_simple - assert 42 == 43
    FAILED failure_demo.py::TestFailing::test_simple_multiline - assert 42 == 54
    FAILED failure_demo.py::TestFailing::test_not - assert not 42
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_text - Asser...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_similar_text
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_multiline_text
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_long_text - ...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_long_text_multiline
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_list - asser...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_list_long - ...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_dict - Asser...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_set - assert...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_longer_list
    FAILED failure_demo.py::TestSpecialisedExplanations::test_in_list - asser...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_multiline
    FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_single
    FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_single_long
    FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_single_long_term
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_dataclass - ...
    FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_attrs - Asse...
    FAILED failure_demo.py::test_attribute - assert 1 == 2
    FAILED failure_demo.py::test_attribute_instance - AssertionError: assert ...
    FAILED failure_demo.py::test_attribute_failure - Exception: Failed to get...
    FAILED failure_demo.py::test_attribute_multiple - AssertionError: assert ...
    FAILED failure_demo.py::TestRaises::test_raises - ValueError: invalid lit...
    FAILED failure_demo.py::TestRaises::test_raises_doesnt - Failed: DID NOT ...
    FAILED failure_demo.py::TestRaises::test_raise - ValueError: demo error
    FAILED failure_demo.py::TestRaises::test_tupleerror - ValueError: not eno...
    FAILED failure_demo.py::TestRaises::test_reinterpret_fails_with_print_for_the_fun_of_it
    FAILED failure_demo.py::TestRaises::test_some_error - NameError: name 'na...
    FAILED failure_demo.py::test_dynamic_compile_shows_nicely - AssertionError
    FAILED failure_demo.py::TestMoreErrors::test_complex_error - assert 44 == 43
    FAILED failure_demo.py::TestMoreErrors::test_z1_unpack_error - ValueError...
    FAILED failure_demo.py::TestMoreErrors::test_z2_type_error - TypeError: c...
    FAILED failure_demo.py::TestMoreErrors::test_startswith - AssertionError:...
    FAILED failure_demo.py::TestMoreErrors::test_startswith_nested - Assertio...
    FAILED failure_demo.py::TestMoreErrors::test_global_func - assert False
    FAILED failure_demo.py::TestMoreErrors::test_instance - assert 42 != 42
    FAILED failure_demo.py::TestMoreErrors::test_compare - assert 11 < 5
    FAILED failure_demo.py::TestMoreErrors::test_try_finally - assert 1 == 0
    FAILED failure_demo.py::TestCustomAssertMsg::test_single_line - Assertion...
    FAILED failure_demo.py::TestCustomAssertMsg::test_multiline - AssertionEr...
    FAILED failure_demo.py::TestCustomAssertMsg::test_custom_repr - Assertion...
    ============================ 44 failed in 0.12s ============================