Exception behaviour changed
parse_tag("-")Packaging.tags.InvalidTag is a subclass of builtins.ValueError.
Same reasoning as C1: the refactor changes the exception type for a tag like '-' that lacks three components, raising InvalidTag instead of the original ValueError, without any documented intention.
Found by: Nemotron strategy search, Ultra's planned example, project's test strings, hostile mutation, search sample · also caught by: Plain Hypothesis, Mutations of the PR's own test strings, Nemotron plan only
ran onToken Factory Sandboxes · image 5c5765e3-5a87-48f2-8b21-497e56c1292b
Regression test verified passes on base, fails on head
def test_1236_p2_outcome_1():
"""Breakwater P2: base behaviour pinned (found by differential testing; label: needs-human)."""
import pytest
from packaging.tags import parse_tag
with pytest.raises(ValueError) as excinfo:
parse_tag('-')
assert type(excinfo.value) is ValueError # exact type: a subclass would be a behaviour change
Reproduce
uv run breakwater probe --repo https://github.com/pypa/packaging --base e6cd4be75370 --head 1529771b80cf --target packaging.tags:parse_tag --backend contree --input "-"5 near-duplicate classes same behaviour, inputs with extra traits
parse_tag("")base raises ValueError · head raises InvalidTag test verifiedparse_tag("- ")base raises ValueError · head raises InvalidTag test verifiedparse_tag("\u001b-")base raises ValueError · head raises InvalidTag test verifiedparse_tag("-ç")base raises ValueError · head raises InvalidTag test verifiedparse_tag("- ")base raises ValueError · head raises InvalidTag test verified