File: test_message.py

package info (click to toggle)
pytest-check 2.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 480 kB
  • sloc: python: 2,220; sh: 17; makefile: 6
file content (12 lines) | stat: -rw-r--r-- 573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
from typing import Callable


def test_check_without_message_shows_default_format(run_example_test: Callable) -> None:
    result = run_example_test("test_example_message.py", "baseline")
    result.stdout.fnmatch_lines(["FAILURE: check 1 == 2"])
    result.stdout.no_fnmatch_line("FAILURE: check 1 == 2: comment about a=1 != b=2")


def test_check_with_message_shows_custom_message(run_example_test: Callable) -> None:
    result = run_example_test("test_example_message.py", "message")
    result.stdout.fnmatch_lines(["FAILURE: check 1 == 2: comment about a=1 != b=2"])