Skip to content

Inconsistent Testing Reports #25631

@hhornburg

Description

@hhornburg

Type: Bug

Behaviour

Testing shows a passed pytest test, even though subtests failed.

Steps to reproduce:

  1. Create test_foo.py with following content:
def test_bar(subtests):
    # with subtests.test("True"):
    #    assert True
    with subtests.test("ValueError"):
        raise ValueError()
  1. Set up testing to discover test
  2. run test & see that it shows as failed (expected)
  3. now uncomment the first subtest
  4. run test & see that for whatever reason it shows as passed, even though nothing was changed about the second test.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2025-12-05 13:31:31.472 [info] ============================= test session starts =============================
platform win32 -- Python 3.12.6, pytest-9.0.1, pluggy-1.6.0

2025-12-05 13:31:31.474 [info] rootdir: d:\Random\pytest_vscode_bug
plugins: dash-3.0.0

2025-12-05 13:31:31.478 [info] collected 1 item


2025-12-05 13:31:31.478 [info] <Dir pytest_vscode_bug>
  <Module test_foo.py>
    <Function test_bar>

2025-12-05 13:31:31.479 [info] 
========================== 1 test collected in 0.01s ==========================

Metadata

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bugconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions