Repository navigation
Conversation
adithya-s-k
left a comment
There was a problem hiding this comment.
Useful addition, but a real unittest case is still dropped by both parser copies: with self.subTest("edge case", i=1): self.assertEqual(1, 2).
TextTestRunner prints test_named (pkg.T.test_named) [edge case] (i=1) ... FAIL, plus the matching failure footer. Both parsers return {} because _NAME_RE rejects the message. That loses the failing parent and prevents F2P detection.
Please support named subtests (with and without parameters), retain the parent ID and worst-status behavior, and add tests using real TextTestRunner output in both copies. #164 is now merged, so the stderr dependency is resolved.
Python unittest and Django commands previously fell back to the pytest parser and produced no oracle. Add TextTestRunner parsing in both parser copies, runner detection, and the verbosity flags needed to expose test identities. Group subtests under stable parent identities, accept nested parameter values, preserve the worst status, and keep unittest count footers out of the pytest fallback. Closes huggingface#167
TextTestRunner includes the subtest message before its parameters. Match and discard that full suffix so both parser copies retain the stable parent identity, including when the message contains an ellipsis.
a798cac to
34e42c9
Compare
|
Fixed in 34e42c9. The regression test now generates the exact output with a real
Both collapse to I also rebased onto current main, so the merged #164 commit is no longer in this PR. Full suite: 2151 passed, 6 skipped; ruff clean. |
Summary
unittestand DjangoTextTestRunneroutput in both the generation parser and standalone verifier.python -m unittest,manage.py testand Djangoruntests.py, adding the verbosity each runner needs to expose stable test identities.Test plan
uv run --all-extras pytest -q(2151 passed, 6 skipped)uv run ruff check .uv run ruff format --check .TextTestRunnerand parse it through both parser copiesOut of scope
unittest.TestResultoutput formats.Closes #167