Repository navigation
fix(bite): a Traceback after pytest's all-passed line is not a failing test - #262
Merged
Merged
Conversation
…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
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by CH · project thread
What was wrong, what you changed, how you checked:
Bite treats any output line that matches
Tracebackas a failing test (DEFAULT_FAILinbite.py). On marketcalls/openalgo, the CI test list finishes with639 passed, 8 warnings in 38.11sand 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, noerror), a line flagged only because it saysTracebackdoesn't count anymore. A failed test, a bad exit code, or a customtest_fail_patternstill fail the same way as before.Checked:
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.This probably accounts for some of the "tests already fail" skips in the Big Number study too.
python -m pytestpasses. No message wording changed.Lesson (plain words):
Assisted-by: Claude Code
Generated by Claude Code