File: test_example_context_manager_pass.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 (20 lines) | stat: -rw-r--r-- 325 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
"""
Context manater with one or multiple blocks.
"""
from pytest_check import check


def test_one_with_block():
    with check:
        x = 3
        assert 1 < x < 4


def test_multiple_with_blocks():
    x = 3
    with check:
        assert 1 < x
    with check:
        assert x < 4
    with check:
        assert x == 3