Prevent --update-functional-output from deleting or overwriting fallback versioned output files for other Python versions.#10950
Prevent --update-functional-output from deleting or overwriting fallback versioned output files for other Python versions.#10950mchris86 wants to merge 2 commits intopylint-dev:mainfrom
Conversation
…ack versioned output files for other Python versions.
for more information, see https://pre-commit.ci
|
Thank you for working on pylint; I was planning on using pytest-remaster for the functional tests (there's an annoying number of edge cases and test to do to make it right and pylint main purpose is not to create a testing framework). I can push my work in progress if it helps |
|
Thanks for the context! |
|
Pushed in https://github.com/pylint-dev/pylint/tree/pytest-remaster, it's pretty raw still |
|
Thanks, I looked into the It looks like In the remaster version, that shows up here: If In my attempt I handled this by detecting fallback outputs and skipping updates in that case. I'd be happy to help handle this in the remaster approach if that would be useful. |
|
Sure, a new look on the pytest-remaster implementation would be great ! |
Type of Changes
Description
Closes #10844
Fix
--update-functional-outputso it does not delete or overwrite fallback versioned expected-output files.When Pylint runs on a newer Python version (e.g. 3.14) and no matching output file exists (like
.314.txt), it falls back to an older version (e.g. .313.txt). The problem is that--update-functional-outputwould then modify that fallback file, when it shouldn't.The fix adds a way to detect when the expected output file is a fallback. In such cases, the update logic skips deleting/overwriting the file.
Regression tests are added to cover both cases:
Testing
Before this fix, the new tests fail because the fallback file is modified. After applying the fix, all tests pass.