Repository navigation
test: add coverage for query key sorting in URL.render_as_string - #13785
Sudhakar7J wants to merge 1 commit into
Conversation
The query keys are sorted in render_as_string, but existing parse/connect tests used alphabetically ordered query strings, so removing the sort did not fail them. Add a case with unsorted keys and assert stable rendering and hashing. Refs: sqlalchemy#13784
|
Hi, and thanks for the pull request! This project accepts pull requests only for issues that a maintainer has already marked with the open for pull requests label. That way we can settle on an approach before anyone spends time writing code. This pull request references issue #13784, which hasn't been marked open for pull requests, so the change isn't authorized yet and I'm closing it automatically. Once a maintainer adds the label to #13784, reopen this pull request and it will stay open. If #13784 needs more detail before that can happen, a complete runnable example is usually the missing piece, and adding one to the issue is the fastest way to get there. This is automatic and procedural. It isn't a judgment on your change, and nothing you've written here is lost. Thanks for your interest in the project! |
Description
Adds a regression test for query key ordering in
URL.render_as_string(). Existingtest_parseconnect.pycases use alphabetically ordered query strings, so the currentkeys.sort()behavior was not exercised. This adds a case with unsorted keys and asserts stable string rendering, equality, hashing, and set behavior.Refs #13784
Checklist
render_as_stringsorts query keys;__hash__uses the rendered string).Local verification
uv run --no-project --with pytest --with typing-extensions python -m pytest test/engine/test_parseconnect.py -k "render_as_string_query_key_sort" -q→ 1 passed, 151 deselected.lib/source:make_url("d://h/db?b=2&a=1").render_as_string()returnsd://h/db?a=1&b=2and hashes/equality are stable.Windows 11, Python 3.15.2, pytest 9.2.0 (SQLAlchemy main @ 4e974a0).