Skip to content

Pytest failed line inspection

Marks the line where a pytest test failed, providing visual feedback directly in the editor.

def test_total():
    total = calculate_total([10, 20])
    assert total == 25
def test_total():
    total = calculate_total([10, 20])
    assert total == 25  # highlighted when pytest reports this line as failed

Notes

  • The highlight is based on the last pytest failure location remembered by BetterPy.
  • The feature works together with Use actual test outcome when an assertion diff is available.
  • The feature is gated by the Pytest failed line inspection setting under Settings | BetterPy | Testing (Pytest) | Assertions & Test Editing.