Skip to content

Python: Pretty print models in test#21266

Merged
owen-mc merged 1 commit intogithub:mainfrom
owen-mc:python/pretty-print-models-in-test
Feb 4, 2026
Merged

Python: Pretty print models in test#21266
owen-mc merged 1 commit intogithub:mainfrom
owen-mc:python/pretty-print-models-in-test

Conversation

@owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Feb 4, 2026

Otherwise the tests breaks when unrelated changes are made because the model numbers change

Otherwise the tests breaks when unrelated changes are made because the
model numbers change
@owen-mc owen-mc requested a review from a team as a code owner February 4, 2026 10:53
Copilot AI review requested due to automatic review settings February 4, 2026 10:53
@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Feb 4, 2026
@github-actions github-actions bot added the Python label Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds pretty printing of models in the CWE-1427 Prompt Injection test to prevent test failures when unrelated changes cause model numbers to change.

Changes:

  • Modified test configuration to use PrettyPrintModels.ql postprocessing
  • Updated expected test output to use sequential model numbers instead of arbitrary internal IDs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
python/ql/test/experimental/query-tests/Security/CWE-1427-PromptInjection/PromptInjection.qlref Added PrettyPrintModels.ql to postprocess steps using YAML list syntax
python/ql/test/experimental/query-tests/Security/CWE-1427-PromptInjection/PromptInjection.expected Updated model references from MaD:94 and MaD:58614 to MaD:1 and MaD:2; added models section with pretty-printed model definitions

@owen-mc owen-mc merged commit 544931f into github:main Feb 4, 2026
19 checks passed
@owen-mc owen-mc deleted the python/pretty-print-models-in-test branch February 4, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants