Skip to content

fix(bite): a Traceback after pytest's all-passed line is not a failing test - #262

Merged
connabyss merged 1 commit into
mainfrom
claude/project-thread-3aapmt
Nov 24, 2026
Merged

connabyss merged 1 commit into
mainfrom
claude/project-thread-3aapmt

Conversation

@connabyss

Copy link
Copy Markdown
Owner

Requested by CH · project thread

What was wrong, what you changed, how you checked:

Bite treats any output line that matches Traceback as a failing test (DEFAULT_FAIL in bite.py). On marketcalls/openalgo, the CI test list finishes with 639 passed, 8 warnings in 38.11s and exits 0. After that, an atexit hook logs to a stream pytest has already closed, which prints --- Logging error --- Traceback .... Bite read that as "tests already fail" and skipped every commit in the project.

The change: when the fail pattern is the default, the exit code is ok, and pytest's own closing line says everything passed (no failed, no error), a line flagged only because it says Traceback doesn't count anymore. A failed test, a bad exit code, or a custom test_fail_pattern still fail the same way as before.

Checked:

  • New tests/test_traceback_after_pytest_passed.py (4 tests). The all-passed case fails without the change and passes with it. The other three show a Traceback still counts as a failure with no passing summary, with a failed test, or with a bad exit code.
  • python -m pytest -n auto: 462 passed, 1 skipped.
  • bite live: a test noticed the change.
  • On the real openalgo case: patched Bite now says ⚠️ NO TEST NOTICED for 498c356e. Before, it said "tests already fail".

This probably accounts for some of the "tests already fail" skips in the Big Number study too.

  • The title says what changed, in the Conventional Commit style.
  • It links the issue it fixes: n/a, found during today's catch hunt
  • For a bug fix: a test that fails without the change and passes with it.
  • python -m pytest passes. No message wording changed.

Lesson (plain words):

  1. Bite used to decide "the tests failed" by looking for scary words like "Traceback" anywhere in the output.
  2. Some projects print a harmless Traceback after all their tests have passed, so Bite skipped whole projects for no reason.
  3. Fix: when pytest's own last line says everything passed and the exit code is fine, Bite trusts that over the stray word.

Assisted-by: Claude Code


Generated by Claude Code

…g test

Bite reads any output line matching "Traceback" as a failure. A pytest
run that passes every test, exits 0, and then has an atexit hook log to
a closed stream ("--- Logging error --- Traceback ...") was read as
"tests already fail", so the whole project was skipped. Found on
marketcalls/openalgo: 639 passed, exit 0, every commit skipped.

With the default fail pattern, an ok exit code and pytest's own closing
line saying everything passed, a line flagged only for "Traceback" no
longer counts. A failed test, a bad exit code or a custom
test_fail_pattern still fail as before.

Assisted-by: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175Q8iDHXZrMvDfyq5zZbfi
@connabyss connabyss self-assigned this Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bite ✅ Bite-proof. Nice work.

Bite took each change out, one at a time, and a test noticed every time. If one breaks later, that test will warn you.

Badge for your README: [![Bite-proof ✅](https://img.shields.io/badge/Bite--proof-%E2%9C%85-black)](https://github.com/connabyss/bite)

  • ✅ The test test_traceback_after_all_passed_is_not_a_failure noticed it was gone. If this change breaks later, that test will warn you.
    Commit d2b4cefc: “fix(bite): a Traceback after pytest's all-passed line is not a failing test”
How Bite checks

Bite asks one question about each change: if it disappeared, would any test notice? It takes the change out, runs your tests, and puts it back. What is Bite?

@connabyss
connabyss merged commit fed614a into main Nov 24, 2026
18 checks passed
@connabyss
connabyss deleted the claude/project-thread-3aapmt branch November 24, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant