Untitled

 avatar
unknown
plain_text
25 days ago
553 B
5
Indexable
# tests/examples/test_soft_assertions.py
from pytest_bdd import scenario, then
from smart_assertions import soft_assert, verify_expectations

@scenario("../features/soft_assertions.feature", "Multiple validations are reported together")
def test_soft_assertions():
    pass

@then("several validations are checked softly")
def several_validations_are_checked_softly():
    soft_assert(1 == 1, "first check should pass")
    soft_assert(2 == 3, "second check should fail")
    soft_assert("a" == "b", "third check should fail")

    verify_expectations()
Editor is loading...
Leave a Comment