[tests] Fix import-time SQLite creation and add tmp_path fixtures for test isolation#174
Open
lin121291 wants to merge 1 commit into52North:mainfrom
Open
[tests] Fix import-time SQLite creation and add tmp_path fixtures for test isolation#174lin121291 wants to merge 1 commit into52North:mainfrom
lin121291 wants to merge 1 commit into52North:mainfrom
Conversation
Move database creation from class body to pytest fixtures. Eliminates file pollution and improves test isolation.
23f2c81 to
b1513f4
Compare
Collaborator
|
Hi @lin121291, thank you for your PR. We appreciate the time and effort that was put into it. Please be aware that we require to follow 52 North's CLA guidelines for all PRs and, in particular, fill the 52°North Contributor License Agreement. As long as this has not been filled, I can not assign you to any issues or merge any PRs. Please don't hesitate to contact me in case of related questions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
Further Details:
Summary:
Problem:
The original test files created SQLite database files in the class body, which executes at import time rather than test runtime. This caused several issues:
gdfDB.sqliteSolution:
Replace ad-hoc database creation with proper pytest fixtures:
tmp_path_factoryBehaviour before: Tests created
gdfDB.sqlitein working directory at import time, file remained after testsBehaviour after: Tests create databases in temporary directories during test execution, automatic cleanup
Dependencies:
No new dependencies added.
PR Checklist:
In the context of this PR, I: