Debian Codegraph @

doc/en/example/reportingdemo.rst

raw
1 .. _`tbreportdemo`:
2
3 Demo of Python failure reports with pytest
4 ==========================================
5
6 Here is a nice run of several failures and how ``pytest`` presents things:
7
8 .. code-block:: pytest
9
10 assertion $ pytest failure_demo.py
11 =========================== test session starts ============================
12 platform linux -- Python 3.x.y, pytest-9.x.y, pluggy-1.x.y
13 rootdir: /home/sweet/project/assertion
14 collected 44 items
15
16 failure_demo.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [100%]
17
18 ================================= FAILURES =================================
19 ___________________________ test_generative[3-6] ___________________________
20
21 param1 = 3, param2 = 6
22
23 @pytest.mark.parametrize("param1, param2", [(3, 6)])
24 def test_generative(param1, param2):
25 > assert param1 * 2 < param2
26 E assert (3 * 2) < 6
27
28 failure_demo.py:21: AssertionError
29 _________________________ TestFailing.test_simple __________________________
30
31 self = <failure_demo.TestFailing object at 0xdeadbeef0001>
32
33 def test_simple(self):
34 def f():
35 return 42
36
37 def g():
38 return 43
39
40 > assert f() == g()
41 E assert 42 == 43
42 E + where 42 = <function TestFailing.test_simple.<locals>.f at 0xdeadbeef0002>()
43 E + and 43 = <function TestFailing.test_simple.<locals>.g at 0xdeadbeef0003>()
44
45 failure_demo.py:32: AssertionError
46 ____________________ TestFailing.test_simple_multiline _____________________
47
48 self = <failure_demo.TestFailing object at 0xdeadbeef0004>
49
50 def test_simple_multiline(self):
51 > otherfunc_multi(42, 6 * 9)
52
53 failure_demo.py:35:
54 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
55
56 a = 42, b = 54
57
58 def otherfunc_multi(a, b):
59 > assert a == b
60 E assert 42 == 54
61
62 failure_demo.py:16: AssertionError
63 ___________________________ TestFailing.test_not ___________________________
64
65 self = <failure_demo.TestFailing object at 0xdeadbeef0005>
66
67 def test_not(self):
68 def f():
69 return 42
70
71 > assert not f()
72 E assert not 42
73 E + where 42 = <function TestFailing.test_not.<locals>.f at 0xdeadbeef0006>()
74
75 failure_demo.py:41: AssertionError
76 _________________ TestSpecialisedExplanations.test_eq_text _________________
77
78 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0007>
79
80 def test_eq_text(self):
81 > assert "spam" == "eggs"
82 E AssertionError: assert 'spam' == 'eggs'
83 E
84 E - eggs
85 E + spam
86
87 failure_demo.py:46: AssertionError
88 _____________ TestSpecialisedExplanations.test_eq_similar_text _____________
89
90 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0008>
91
92 def test_eq_similar_text(self):
93 > assert "foo 1 bar" == "foo 2 bar"
94 E AssertionError: assert 'foo 1 bar' == 'foo 2 bar'
95 E
96 E - foo 2 bar
97 E ? ^
98 E + foo 1 bar
99 E ? ^
100
101 failure_demo.py:49: AssertionError
102 ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________
103
104 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0009>
105
106 def test_eq_multiline_text(self):
107 > assert "foo\nspam\nbar" == "foo\neggs\nbar"
108 E AssertionError: assert 'foo\nspam\nbar' == 'foo\neggs\nbar'
109 E
110 E foo
111 E - eggs
112 E + spam
113 E bar
114
115 failure_demo.py:52: AssertionError
116 ______________ TestSpecialisedExplanations.test_eq_long_text _______________
117
118 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000a>
119
120 def test_eq_long_text(self):
121 a = "1" * 100 + "a" + "2" * 100
122 b = "1" * 100 + "b" + "2" * 100
123 > assert a == b
124 E AssertionError: assert '111111111111...2222222222222' == '111111111111...2222222222222'
125 E
126 E Skipping 90 identical leading characters in diff, use -v to show
127 E Skipping 91 identical trailing characters in diff, use -v to show
128 E - 1111111111b222222222
129 E ? ^
130 E + 1111111111a222222222
131 E ? ^
132
133 failure_demo.py:57: AssertionError
134 _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________
135
136 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000b>
137
138 def test_eq_long_text_multiline(self):
139 a = "1\n" * 100 + "a" + "2\n" * 100
140 b = "1\n" * 100 + "b" + "2\n" * 100
141 > assert a == b
142 E AssertionError: assert '1\n1\n1\n1\n...n2\n2\n2\n2\n' == '1\n1\n1\n1\n...n2\n2\n2\n2\n'
143 E
144 E Skipping 190 identical leading characters in diff, use -v to show
145 E Skipping 191 identical trailing characters in diff, use -v to show
146 E 1
147 E 1
148 E 1
149 E 1...
150 E
151 E ...Full output truncated (7 lines hidden), use '-vv' to show
152
153 failure_demo.py:62: AssertionError
154 _________________ TestSpecialisedExplanations.test_eq_list _________________
155
156 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000c>
157
158 def test_eq_list(self):
159 > assert [0, 1, 2] == [0, 1, 3]
160 E assert [0, 1, 2] == [0, 1, 3]
161 E
162 E At index 2 diff: 2 != 3
163 E Use -v to get more diff
164
165 failure_demo.py:65: AssertionError
166 ______________ TestSpecialisedExplanations.test_eq_list_long _______________
167
168 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000d>
169
170 def test_eq_list_long(self):
171 a = [0] * 100 + [1] + [3] * 100
172 b = [0] * 100 + [2] + [3] * 100
173 > assert a == b
174 E assert [0, 0, 0, 0, 0, 0, ...] == [0, 0, 0, 0, 0, 0, ...]
175 E
176 E At index 100 diff: 1 != 2
177 E Use -v to get more diff
178
179 failure_demo.py:70: AssertionError
180 _________________ TestSpecialisedExplanations.test_eq_dict _________________
181
182 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000e>
183
184 def test_eq_dict(self):
185 > assert {"a": 0, "b": 1, "c": 0} == {"a": 0, "b": 2, "d": 0}
186 E AssertionError: assert {'a': 0, 'b': 1, 'c': 0} == {'a': 0, 'b': 2, 'd': 0}
187 E
188 E Omitting 1 identical items, use -vv to show
189 E Differing items:
190 E {'b': 1} != {'b': 2}
191 E Left contains 1 more item:
192 E {'c': 0}
193 E Right contains 1 more item:
194 E {'d': 0}
195 E Use -v to get more diff
196
197 failure_demo.py:73: AssertionError
198 _________________ TestSpecialisedExplanations.test_eq_set __________________
199
200 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef000f>
201
202 def test_eq_set(self):
203 > assert {0, 10, 11, 12} == {0, 20, 21}
204 E assert {0, 10, 11, 12} == {0, 20, 21}
205 E
206 E Extra items in the left set:
207 E 10
208 E 11
209 E 12
210 E Extra items in the right set:
211 E 20
212 E 21
213 E Use -v to get more diff
214
215 failure_demo.py:76: AssertionError
216 _____________ TestSpecialisedExplanations.test_eq_longer_list ______________
217
218 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0010>
219
220 def test_eq_longer_list(self):
221 > assert [1, 2] == [1, 2, 3]
222 E assert [1, 2] == [1, 2, 3]
223 E
224 E Right contains one more item: 3
225 E Use -v to get more diff
226
227 failure_demo.py:79: AssertionError
228 _________________ TestSpecialisedExplanations.test_in_list _________________
229
230 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0011>
231
232 def test_in_list(self):
233 > assert 1 in [0, 2, 3, 4, 5]
234 E assert 1 in [0, 2, 3, 4, 5]
235
236 failure_demo.py:82: AssertionError
237 __________ TestSpecialisedExplanations.test_not_in_text_multiline __________
238
239 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0012>
240
241 def test_not_in_text_multiline(self):
242 text = "some multiline\ntext\nwhich\nincludes foo\nand a\ntail"
243 > assert "foo" not in text
244 E AssertionError: assert 'foo' not in 'some multil...nand a\ntail'
245 E
246 E 'foo' is contained here:
247 E some multiline
248 E text
249 E which
250 E includes foo
251 E ? +++
252 E and a
253 E tail
254
255 failure_demo.py:86: AssertionError
256 ___________ TestSpecialisedExplanations.test_not_in_text_single ____________
257
258 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0013>
259
260 def test_not_in_text_single(self):
261 text = "single foo line"
262 > assert "foo" not in text
263 E AssertionError: assert 'foo' not in 'single foo line'
264 E
265 E 'foo' is contained here:
266 E single foo line
267 E ? +++
268
269 failure_demo.py:90: AssertionError
270 _________ TestSpecialisedExplanations.test_not_in_text_single_long _________
271
272 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0014>
273
274 def test_not_in_text_single_long(self):
275 text = "head " * 50 + "foo " + "tail " * 20
276 > assert "foo" not in text
277 E AssertionError: assert 'foo' not in 'head head h...l tail tail '
278 E
279 E 'foo' is contained here:
280 E head head foo tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail
281 E ? +++
282
283 failure_demo.py:94: AssertionError
284 ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______
285
286 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0015>
287
288 def test_not_in_text_single_long_term(self):
289 text = "head " * 50 + "f" * 70 + "tail " * 20
290 > assert "f" * 70 not in text
291 E AssertionError: assert 'fffffffffff...ffffffffffff' not in 'head head h...l tail tail '
292 E
293 E 'ffffffffffffffffff...fffffffffffffffffff' is contained here:
294 E head head fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffftail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail
295 E ? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
296
297 failure_demo.py:98: AssertionError
298 ______________ TestSpecialisedExplanations.test_eq_dataclass _______________
299
300 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0016>
301
302 def test_eq_dataclass(self):
303 from dataclasses import dataclass
304
305 @dataclass
306 class Foo:
307 a: int
308 b: str
309
310 left = Foo(1, "b")
311 right = Foo(1, "c")
312 > assert left == right
313 E AssertionError: assert TestSpecialis...oo(a=1, b='b') == TestSpecialis...oo(a=1, b='c')
314 E
315 E Omitting 1 identical items, use -vv to show
316 E Differing attributes:
317 E ['b']
318 E
319 E Drill down into differing attribute b:
320 E b: 'b' != 'c'
321 E - c
322 E + b
323
324 failure_demo.py:110: AssertionError
325 ________________ TestSpecialisedExplanations.test_eq_attrs _________________
326
327 self = <failure_demo.TestSpecialisedExplanations object at 0xdeadbeef0017>
328
329 def test_eq_attrs(self):
330 import attr
331
332 @attr.s
333 class Foo:
334 a = attr.ib()
335 b = attr.ib()
336
337 left = Foo(1, "b")
338 right = Foo(1, "c")
339 > assert left == right
340 E AssertionError: assert Foo(a=1, b='b') == Foo(a=1, b='c')
341 E
342 E Omitting 1 identical items, use -vv to show
343 E Differing attributes:
344 E ['b']
345 E
346 E Drill down into differing attribute b:
347 E b: 'b' != 'c'
348 E - c
349 E + b
350
351 failure_demo.py:122: AssertionError
352 ______________________________ test_attribute ______________________________
353
354 def test_attribute():
355 class Foo:
356 b = 1
357
358 i = Foo()
359 > assert i.b == 2
360 E assert 1 == 2
361 E + where 1 = <failure_demo.test_attribute.<locals>.Foo object at 0xdeadbeef0018>.b
362
363 failure_demo.py:130: AssertionError
364 _________________________ test_attribute_instance __________________________
365
366 def test_attribute_instance():
367 class Foo:
368 b = 1
369
370 > assert Foo().b == 2
371 E AssertionError: assert 1 == 2
372 E + where 1 = <failure_demo.test_attribute_instance.<locals>.Foo object at 0xdeadbeef0019>.b
373 E + where <failure_demo.test_attribute_instance.<locals>.Foo object at 0xdeadbeef0019> = <class 'failure_demo.test_attribute_instance.<locals>.Foo'>()
374
375 failure_demo.py:137: AssertionError
376 __________________________ test_attribute_failure __________________________
377
378 def test_attribute_failure():
379 class Foo:
380 def _get_b(self):
381 raise Exception("Failed to get attrib")
382
383 b = property(_get_b)
384
385 i = Foo()
386 > assert i.b == 2
387 ^^^
388
389 failure_demo.py:148:
390 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
391
392 self = <failure_demo.test_attribute_failure.<locals>.Foo object at 0xdeadbeef001a>
393
394 def _get_b(self):
395 > raise Exception("Failed to get attrib")
396 E Exception: Failed to get attrib
397
398 failure_demo.py:143: Exception
399 _________________________ test_attribute_multiple __________________________
400
401 def test_attribute_multiple():
402 class Foo:
403 b = 1
404
405 class Bar:
406 b = 2
407
408 > assert Foo().b == Bar().b
409 E AssertionError: assert 1 == 2
410 E + where 1 = <failure_demo.test_attribute_multiple.<locals>.Foo object at 0xdeadbeef001b>.b
411 E + where <failure_demo.test_attribute_multiple.<locals>.Foo object at 0xdeadbeef001b> = <class 'failure_demo.test_attribute_multiple.<locals>.Foo'>()
412 E + and 2 = <failure_demo.test_attribute_multiple.<locals>.Bar object at 0xdeadbeef001c>.b
413 E + where <failure_demo.test_attribute_multiple.<locals>.Bar object at 0xdeadbeef001c> = <class 'failure_demo.test_attribute_multiple.<locals>.Bar'>()
414
415 failure_demo.py:158: AssertionError
416 __________________________ TestRaises.test_raises __________________________
417
418 self = <failure_demo.TestRaises object at 0xdeadbeef001d>
419
420 def test_raises(self):
421 s = "qwe"
422 > raises(TypeError, int, s)
423 E ValueError: invalid literal for int() with base 10: 'qwe'
424
425 failure_demo.py:168: ValueError
426 ______________________ TestRaises.test_raises_doesnt _______________________
427
428 self = <failure_demo.TestRaises object at 0xdeadbeef001e>
429
430 def test_raises_doesnt(self):
431 > raises(OSError, int, "3")
432 E Failed: DID NOT RAISE OSError
433
434 failure_demo.py:171: Failed
435 __________________________ TestRaises.test_raise ___________________________
436
437 self = <failure_demo.TestRaises object at 0xdeadbeef001f>
438
439 def test_raise(self):
440 > raise ValueError("demo error")
441 E ValueError: demo error
442
443 failure_demo.py:174: ValueError
444 ________________________ TestRaises.test_tupleerror ________________________
445
446 self = <failure_demo.TestRaises object at 0xdeadbeef0020>
447
448 def test_tupleerror(self):
449 > a, b = [1] # noqa: F841
450 ^^^^
451 E ValueError: not enough values to unpack (expected 2, got 1)
452
453 failure_demo.py:177: ValueError
454 ______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______
455
456 self = <failure_demo.TestRaises object at 0xdeadbeef0021>
457
458 def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
459 items = [1, 2, 3]
460 print(f"items is {items!r}")
461 > a, b = items.pop()
462 ^^^^
463 E TypeError: cannot unpack non-iterable int object
464
465 failure_demo.py:182: TypeError
466 --------------------------- Captured stdout call ---------------------------
467 items is [1, 2, 3]
468 ________________________ TestRaises.test_some_error ________________________
469
470 self = <failure_demo.TestRaises object at 0xdeadbeef0022>
471
472 def test_some_error(self):
473 > if namenotexi: # noqa: F821
474 ^^^^^^^^^^
475 E NameError: name 'namenotexi' is not defined
476
477 failure_demo.py:185: NameError
478 ____________________ test_dynamic_compile_shows_nicely _____________________
479
480 def test_dynamic_compile_shows_nicely():
481 import importlib.util
482 import sys
483
484 src = "def foo():\n assert 1 == 0\n"
485 name = "abc-123"
486 spec = importlib.util.spec_from_loader(name, loader=None)
487 module = importlib.util.module_from_spec(spec)
488 code = compile(src, name, "exec")
489 exec(code, module.__dict__)
490 sys.modules[name] = module
491 > module.foo()
492
493 failure_demo.py:204:
494 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
495
496 > ???
497 E AssertionError
498
499 abc-123:2: AssertionError
500 ____________________ TestMoreErrors.test_complex_error _____________________
501
502 self = <failure_demo.TestMoreErrors object at 0xdeadbeef0023>
503
504 def test_complex_error(self):
505 def f():
506 return 44
507
508 def g():
509 return 43
510
511 > somefunc(f(), g())
512
513 failure_demo.py:215:
514 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
515 failure_demo.py:12: in somefunc
516 otherfunc(x, y)
517 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
518
519 a = 44, b = 43
520
521 def otherfunc(a, b):
522 > assert a == b
523 E assert 44 == 43
524
525 failure_demo.py:8: AssertionError
526 ___________________ TestMoreErrors.test_z1_unpack_error ____________________
527
528 self = <failure_demo.TestMoreErrors object at 0xdeadbeef0024>
529
530 def test_z1_unpack_error(self):
531 items = []
532 > a, b = items
533 ^^^^
534 E ValueError: not enough values to unpack (expected 2, got 0)
535
536 failure_demo.py:219: ValueError
537 ____________________ TestMoreErrors.test_z2_type_error _____________________
538
539 self = <failure_demo.TestMoreErrors object at 0xdeadbeef0025>
540
541 def test_z2_type_error(self):
542 items = 3
543 > a, b = items
544 ^^^^
545 E TypeError: cannot unpack non-iterable int object
546
547 failure_demo.py:223: TypeError
548 ______________________ TestMoreErrors.test_startswith ______________________
549
550 self = <failure_demo.TestMoreErrors object at 0xdeadbeef0026>
551
552 def test_startswith(self):
553 s = "123"
554 g = "456"
555 > assert s.startswith(g)
556 E AssertionError: assert False
557 E + where False = <built-in method startswith of str object at 0xdeadbeef0027>('456')
558 E + where <built-in method startswith of str object at 0xdeadbeef0027> = '123'.startswith
559
560 failure_demo.py:228: AssertionError
561 __________________ TestMoreErrors.test_startswith_nested ___________________
562
563 self = <failure_demo.TestMoreErrors object at 0xdeadbeef0028>
564
565 def test_startswith_nested(self):
566 def f():
567 return "123"
568
569 def g():
570 return "456"
571
572 > assert f().startswith(g())
573 E AssertionError: assert False
574 E + where False = <built-in method startswith of str object at 0xdeadbeef0027>('456')
575 E + where <built-in method startswith of str object at 0xdeadbeef0027> = '123'.startswith
576 E + where '123' = <function TestMoreErrors.test_startswith_nested.<locals>.f at 0xdeadbeef0029>()
577 E + and '456' = <function TestMoreErrors.test_startswith_nested.<locals>.g at 0xdeadbeef0002>()
578
579 failure_demo.py:237: AssertionError
580 _____________________ TestMoreErrors.test_global_func ______________________
581
582 self = <failure_demo.TestMoreErrors object at 0xdeadbeef002a>
583
584 def test_global_func(self):
585 > assert isinstance(globf(42), float)
586 E assert False
587 E + where False = isinstance(43, float)
588 E + where 43 = globf(42)
589
590 failure_demo.py:240: AssertionError
591 _______________________ TestMoreErrors.test_instance _______________________
592
593 self = <failure_demo.TestMoreErrors object at 0xdeadbeef002b>
594
595 def test_instance(self):
596 self.x = 6 * 7
597 > assert self.x != 42
598 E assert 42 != 42
599 E + where 42 = <failure_demo.TestMoreErrors object at 0xdeadbeef002b>.x
600
601 failure_demo.py:244: AssertionError
602 _______________________ TestMoreErrors.test_compare ________________________
603
604 self = <failure_demo.TestMoreErrors object at 0xdeadbeef002c>
605
606 def test_compare(self):
607 > assert globf(10) < 5
608 E assert 11 < 5
609 E + where 11 = globf(10)
610
611 failure_demo.py:247: AssertionError
612 _____________________ TestMoreErrors.test_try_finally ______________________
613
614 self = <failure_demo.TestMoreErrors object at 0xdeadbeef002d>
615
616 def test_try_finally(self):
617 x = 1
618 try:
619 > assert x == 0
620 E assert 1 == 0
621
622 failure_demo.py:252: AssertionError
623 ___________________ TestCustomAssertMsg.test_single_line ___________________
624
625 self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef002e>
626
627 def test_single_line(self):
628 class A:
629 a = 1
630
631 b = 2
632 > assert A.a == b, "A.a appears not to be b"
633 E AssertionError: A.a appears not to be b
634 E assert 1 == 2
635 E + where 1 = <class 'failure_demo.TestCustomAssertMsg.test_single_line.<locals>.A'>.a
636
637 failure_demo.py:263: AssertionError
638 ____________________ TestCustomAssertMsg.test_multiline ____________________
639
640 self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef002f>
641
642 def test_multiline(self):
643 class A:
644 a = 1
645
646 b = 2
647 > assert A.a == b, (
648 "A.a appears not to be b\nor does not appear to be b\none of those"
649 )
650 E AssertionError: A.a appears not to be b
651 E or does not appear to be b
652 E one of those
653 E assert 1 == 2
654 E + where 1 = <class 'failure_demo.TestCustomAssertMsg.test_multiline.<locals>.A'>.a
655
656 failure_demo.py:270: AssertionError
657 ___________________ TestCustomAssertMsg.test_custom_repr ___________________
658
659 self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef0030>
660
661 def test_custom_repr(self):
662 class JSON:
663 a = 1
664
665 def __repr__(self):
666 return "This is JSON\n{\n 'foo': 'bar'\n}"
667
668 a = JSON()
669 b = 2
670 > assert a.a == b, a
671 E AssertionError: This is JSON
672 E {
673 E 'foo': 'bar'
674 E }
675 E assert 1 == 2
676 E + where 1 = This is JSON\n{\n 'foo': 'bar'\n}.a
677
678 failure_demo.py:283: AssertionError
679 ========================= short test summary info ==========================
680 FAILED failure_demo.py::test_generative[3-6] - assert (3 * 2) < 6
681 FAILED failure_demo.py::TestFailing::test_simple - assert 42 == 43
682 FAILED failure_demo.py::TestFailing::test_simple_multiline - assert 42 == 54
683 FAILED failure_demo.py::TestFailing::test_not - assert not 42
684 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_text - Asser...
685 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_similar_text
686 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_multiline_text
687 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_long_text - ...
688 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_long_text_multiline
689 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_list - asser...
690 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_list_long - ...
691 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_dict - Asser...
692 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_set - assert...
693 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_longer_list
694 FAILED failure_demo.py::TestSpecialisedExplanations::test_in_list - asser...
695 FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_multiline
696 FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_single
697 FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_single_long
698 FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_single_long_term
699 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_dataclass - ...
700 FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_attrs - Asse...
701 FAILED failure_demo.py::test_attribute - assert 1 == 2
702 FAILED failure_demo.py::test_attribute_instance - AssertionError: assert ...
703 FAILED failure_demo.py::test_attribute_failure - Exception: Failed to get...
704 FAILED failure_demo.py::test_attribute_multiple - AssertionError: assert ...
705 FAILED failure_demo.py::TestRaises::test_raises - ValueError: invalid lit...
706 FAILED failure_demo.py::TestRaises::test_raises_doesnt - Failed: DID NOT ...
707 FAILED failure_demo.py::TestRaises::test_raise - ValueError: demo error
708 FAILED failure_demo.py::TestRaises::test_tupleerror - ValueError: not eno...
709 FAILED failure_demo.py::TestRaises::test_reinterpret_fails_with_print_for_the_fun_of_it
710 FAILED failure_demo.py::TestRaises::test_some_error - NameError: name 'na...
711 FAILED failure_demo.py::test_dynamic_compile_shows_nicely - AssertionError
712 FAILED failure_demo.py::TestMoreErrors::test_complex_error - assert 44 == 43
713 FAILED failure_demo.py::TestMoreErrors::test_z1_unpack_error - ValueError...
714 FAILED failure_demo.py::TestMoreErrors::test_z2_type_error - TypeError: c...
715 FAILED failure_demo.py::TestMoreErrors::test_startswith - AssertionError:...
716 FAILED failure_demo.py::TestMoreErrors::test_startswith_nested - Assertio...
717 FAILED failure_demo.py::TestMoreErrors::test_global_func - assert False
718 FAILED failure_demo.py::TestMoreErrors::test_instance - assert 42 != 42
719 FAILED failure_demo.py::TestMoreErrors::test_compare - assert 11 < 5
720 FAILED failure_demo.py::TestMoreErrors::test_try_finally - assert 1 == 0
721 FAILED failure_demo.py::TestCustomAssertMsg::test_single_line - Assertion...
722 FAILED failure_demo.py::TestCustomAssertMsg::test_multiline - AssertionEr...
723 FAILED failure_demo.py::TestCustomAssertMsg::test_custom_repr - Assertion...
724 ============================ 44 failed in 0.12s ============================