File: test_example_context_manager_fail.py

package info (click to toggle)
pytest-check 2.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 432 kB
  • sloc: python: 1,775; sh: 17; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
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
"""
Everything should fail in this file.
This test is useful for testing:
-  messages
- stop on fail (-x)
- pseudo-tracebacks
- lack of tracebacks (--tb=no)
"""

from pytest_check import check


def test_3_failed_checks():
    with check:
        assert 1 == 0
    with check:
        assert 1 > 2
    with check:
        assert 1 < 5 < 4


def test_messages():
    with check("first fail"):
        assert 1 == 0
    with check("second fail"):
        assert 1 > 2
    with check("third fail"):
        assert 1 < 5 < 4