mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
fix(tests): escape the regex in test_verify_pdf's docstring and compile-check tests/*.py (#503)
FindNonAsciiDateRangesTests' docstring (from #498) quotes the regex `\s*`
in a non-raw string. `\s` is an invalid escape sequence, so Python 3.12+
prints a SyntaxWarning for it (CPython gh-98401) when
tests/test_verify_pdf.py is compiled. It is in this repo's own CI log
for a45bbd1 on 3.12, 3.13 and 3.14, at tests/test_verify_pdf.py:75, while
the run stays green. Under `-W error::SyntaxWarning` the module fails to
import and the whole test_verify_pdf suite drops out of the run.
Escaped in the docstring. ToolsCompileWithoutWarnings (#480) only compiled
tools/*.py, which is why this got through; it now compiles tests/*.py too.
With the unescaped docstring it fails naming tests/test_verify_pdf.py, and
it passes with the fix.
Verification on Python 3.10, 3.11, 3.12, 3.13 and 3.14, from a clean
bytecode cache: `python -W error::SyntaxWarning -m unittest discover -s
tests -t .` OK (501 tests, the same count as master),
`tools/lint_skills.py`, `tools/check_framework_version.py`,
`tools/security_guards.py`.
This commit is contained in:
3 files changed
+17
-5
No files matched your search
@@ -105,6 +105,14 @@ per-file diff commands.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **The compile-warning check covers `tests/*.py` too** (`tests/test_verify_pdf.py`,
|
||||
`tests/test_verify_layout.py`) - `FindNonAsciiDateRangesTests`' docstring quotes the regex
|
||||
`\s*` unescaped, so Python 3.12+ prints a `SyntaxWarning` for the invalid escape `\s` when
|
||||
the test module is compiled. It shows up in this repo's own CI log on 3.12, 3.13 and 3.14 while
|
||||
the run stays green, and under `-W error::SyntaxWarning` the module fails to import. Escaped
|
||||
in the docstring; `ToolsCompileWithoutWarnings` now compiles `tests/*.py` as well as
|
||||
`tools/*.py` and fails on the unescaped version.
|
||||
|
||||
- **`linkedin-search detail` no longer fetches an unrelated posting for a URL on another
|
||||
host** - `normalizeId` took the first 6+-digit path segment from *any* URL, so a
|
||||
Greenhouse or Lever apply link (the kind a posting's own page hands out, and what a user
|
||||
|
||||
Reference in new issue
Block a user