← Catalogue

pytest

pytest's `=== FAILURES ===` block, from the first failing test through to the short summary.

pythontesttoolmatcher

Open in playgroundFile on GitHubHistory

Install: ci-doctor matchers add official/pytest

matchers/python/pytest/matcher.yaml

id: pytestrole: toolclassification: [python, test]description: pytest's `=== FAILURES ===` block, from the first failing test through to the short summary.start: ^=+ FAILURES =+end: ^=+ short test summary

In bundles

allpython

Fixtures

Framing stripped per provider. Highlighted lines are what this matcher selects; the marked line is the anchor.

pytest_failure_verboseOpen in playground

1Current runner version: '2.336.0'
2##[group]Operating System
3Ubuntu
424.04.4
5LTS
6##[endgroup]
7Secret source: Actions
8Prepare workflow directory
9Prepare all required actions
10Complete job name: pytest_failure_verbose
11##[group]Set up job
12Image: ubuntu-24.04
13Runner name: 'GitHub Actions 12'
14##[endgroup]
15Download action repository 'actions/checkout@v4'
16Download action repository 'actions/cache@v4'
17##[group]Run actions/checkout@v4
18 with:
19 fetch-depth: 20
20 lfs: false
21##[endgroup]
22Syncing repository: acme/ledger
23##[group]Getting Git version info
24Working directory is '/home/runner/work/ledger/ledger'
25##[endgroup]
26/usr/bin/git checkout --progress --force 8ad41f02
27##[group]Run actions/cache@v4
28 with:
29 path: ~/.cache
30 key: Linux-deps-8ad41f02
31##[endgroup]
32Received 41943040 of 41943040 (100.0%), 40.0 MBs/sec
33Cache restored from key: Linux-deps-8ad41f02
34##[group]Run python -V
35python -V
36python -m pip install -e '.[test]' --quiet
37pytest -q --maxfail=1
38shell: /usr/bin/bash -e {0}
39##[endgroup]
40Using docker image sha256:9f8e7d6c5b4a for python:3.11-slim ...
41Python 3.11.9
42Obtaining file:///builds/team/app
43 Installing build dependencies: started
44 Installing build dependencies: finished with status 'done'
45Successfully installed app-0.4.2 coverage-7.5.1 pytest-8.2.0 pytest-cov-5.0.0
46............................F
47=================================== FAILURES ===================================
48________________________________ test_discount ________________________________
49
50 def test_discount():
51 cart = Cart(items=[Item("book", 30_00)])
52> assert cart.total_with_discount(0.10) == 27_00
53E assert 3000 == 2700
54E + where 3000 = <Cart items=[Item(name='book', cents=3000)]>.total_with_discount(0.1)
55
56tests/test_cart.py:41: AssertionError
57--------------------------- Captured stdout call ---------------------------
58applying discount 0.1 to subtotal 3000
59=========================== short test summary info ============================
60FAILED tests/test_cart.py::test_discount - assert 3000 == 2700
611 failed, 42 passed in 3.18s
62##[error]Process completed with exit code 1.
63##[group]Post Run actions/checkout@v4
64##[endgroup]
65/usr/bin/git version
66git version 2.54.0
67##[group]Post Run actions/upload-artifact@v4
68##[endgroup]
69Artifact upload complete.
70Post job cleanup.
71Cleaning up orphan processes