File: test_example_fail_in_fixture.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 (25 lines) | stat: -rw-r--r-- 331 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
"""
Failures in fixture should result in Error, not Fail.
"""
import pytest

from pytest_check import check


@pytest.fixture()
def a_fixture():
    check.equal(1, 2)


def test_setup_failure(a_fixture):
    pass


@pytest.fixture()
def b_fixture():
    yield
    check.equal(1, 2)


def test_teardown_failure(b_fixture):
    pass