pytest
pytest's `=== FAILURES ===` block, from the first failing test through to the short summary.
pythontesttoolmatcher
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
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
1Running with gitlab-runner 16.11.0 (a1b2c3d4)
2 on shared-runners-manager-3 xY9kLmNp, system ID: s_1a2b3c4d5e6f
3Preparing the "docker+machine" executor
4 Using Docker executor with image python:3.11-slim ...
5Resolving secrets
6Using Docker executor with image python:3.11-slim ...
7Pulling docker image python:3.11-slim ...
8Using docker image sha256:9f8e7d6c5b4a for python:3.11-slim with digest python@sha256:abcd...
9Preparing environment
10Running on runner-xy9klmnp-project-42-concurrent-0 via runner-manager-3...
11Fetching changes with git depth set to 20...
12Initialized empty Git repository in /builds/team/app/.git/
13Created fresh repository.
14Checking out 9f3a1c2e as detached HEAD...
15Skipping Git submodules setup
16Checking cache for pip-3.11-default-protected...
17Downloading cache.zip from https://storage.internal/runner/cache/...
18Successfully extracted cache
19Using docker image sha256:9f8e7d6c5b4a for python:3.11-slim ...
20$ python -V
21Python 3.11.9
22$ python -m pip install -e '.[test]' --quiet
23Obtaining file:///builds/team/app
24 Installing build dependencies: started
25 Installing build dependencies: finished with status 'done'
26Successfully installed app-0.4.2 coverage-7.5.1 pytest-8.2.0 pytest-cov-5.0.0
27$ pytest -q --maxfail=1
28............................F
29=================================== FAILURES ===================================
30________________________________ test_discount ________________________________
31
32 def test_discount():
33 cart = Cart(items=[Item("book", 30_00)])
34> assert cart.total_with_discount(0.10) == 27_00
35E assert 3000 == 2700
36E + where 3000 = <Cart items=[Item(name='book', cents=3000)]>.total_with_discount(0.1)
37
38tests/test_cart.py:41: AssertionError
39--------------------------- Captured stdout call ---------------------------
40applying discount 0.1 to subtotal 3000
41=========================== short test summary info ============================
42FAILED tests/test_cart.py::test_discount - assert 3000 == 2700
431 failed, 42 passed in 3.18s
44Running after_script
45$ ./ci/collect_coverage.sh
46Coverage report written to coverage.xml
47Uploading artifacts for failed job
48Uploading artifacts as "archive" to coordinator... 201 Created id=98812 responseStatus=201 Created
49ERROR: Job failed: exit code 1