Describe the bug
main is red on Python 3.11 and 3.12. tests/vendor/test_re_sub_positional_flag_unit.py::RuntimeDeprecationWarningTests::test_positional_flag_shape_would_warn asserts a DeprecationWarning that CPython only emits from 3.13, with no version guard:
tests/vendor/test_re_sub_positional_flag_unit.py:218
with self.assertWarns(DeprecationWarning):
re.sub(self.PATTERN, ' ', 'a\nb', re.MULTILINE)
AssertionError: DeprecationWarning not triggered
tests/vendor/test_re_sub_positional_flag_unit.py:221: AssertionError
1 failed, 1831 passed, 76 skipped, 45005 subtests passed in 485.74s
Four failing legs — Python 3.11, Python 3.12, Engines Python 3.11, Engines Python 3.12 — are one defect, not four.
Measured: on 3.14.7 the call warns; on 3.11/3.12 it does not. The 'count' is passed as positional argument deprecation landed in CPython 3.13.
Expected behavior
The test skips, or asserts the absence of the warning, below 3.13. The file's own module docstring at :25 already states the boundary — "It is also a live DeprecationWarning on Python 3.13+" — so the knowledge was there and the guard was not. grep -nE "version_info|skipIf|skipUnless" over the file returns nothing.
Additional context
Introduced by #813 (merged as 55e1b756e), and I cleared that PR as review: good-to-go on incomplete CI — it showed 27✅ 0❌ when I looked, but the 3.11/3.12 legs had not finished. That is my error, not the author's: its own verification ran on 3.14 only, which is the documented local interpreter, and the matrix is what exists to catch exactly this.
The sibling test immediately below, test_flags_keyword_shape_does_not_warn, is version-independent and correct — it asserts the absence of a warning, which holds on every version. Only the positive assertion needs gating.
Fix shape, cheapest first:
@unittest.skipIf(sys.version_info < (3, 13), '...') on that one method, naming the CPython version in the reason.
- Or invert it: assert the warning on 3.13+ and its absence below, so both branches are pinned rather than one being skipped.
(2) is better — it keeps coverage on every leg instead of going dark on two of them, and it makes the version boundary itself a tested fact rather than a comment.
Note this is the second time today a test pinned a runtime symptom without gating its version. #788 had the mirror image: typing.final only records __final__ from 3.11, and the guard's boundary had to be pinned by an AST-derived test (test_the_shim_switches_at_the_version_that_added_the_dunder). That is the pattern to copy here.
Related: #813, #796, #788.
Describe the bug
mainis red on Python 3.11 and 3.12.tests/vendor/test_re_sub_positional_flag_unit.py::RuntimeDeprecationWarningTests::test_positional_flag_shape_would_warnasserts aDeprecationWarningthat CPython only emits from 3.13, with no version guard:Four failing legs —
Python 3.11,Python 3.12,Engines Python 3.11,Engines Python 3.12— are one defect, not four.Measured: on 3.14.7 the call warns; on 3.11/3.12 it does not. The
'count' is passed as positional argumentdeprecation landed in CPython 3.13.Expected behavior
The test skips, or asserts the absence of the warning, below 3.13. The file's own module docstring at
:25already states the boundary — "It is also a liveDeprecationWarningon Python 3.13+" — so the knowledge was there and the guard was not.grep -nE "version_info|skipIf|skipUnless"over the file returns nothing.Additional context
Introduced by #813 (merged as
55e1b756e), and I cleared that PR asreview: good-to-goon incomplete CI — it showed 27✅ 0❌ when I looked, but the 3.11/3.12 legs had not finished. That is my error, not the author's: its own verification ran on 3.14 only, which is the documented local interpreter, and the matrix is what exists to catch exactly this.The sibling test immediately below,
test_flags_keyword_shape_does_not_warn, is version-independent and correct — it asserts the absence of a warning, which holds on every version. Only the positive assertion needs gating.Fix shape, cheapest first:
@unittest.skipIf(sys.version_info < (3, 13), '...')on that one method, naming the CPython version in the reason.(2) is better — it keeps coverage on every leg instead of going dark on two of them, and it makes the version boundary itself a tested fact rather than a comment.
Note this is the second time today a test pinned a runtime symptom without gating its version. #788 had the mirror image:
typing.finalonly records__final__from 3.11, and the guard's boundary had to be pinned by an AST-derived test (test_the_shim_switches_at_the_version_that_added_the_dunder). That is the pattern to copy here.Related: #813, #796, #788.