Merged
Conversation
- Updated the Comparer class to include a `dispose_engines` flag for automatic disposal of database engines after comparison. - Modified the `from_params` classmethod to set this flag to true by default. - Added a `dispose` method to close pooled connections. - Updated README.md to reflect these changes and provide usage notes. - Introduced tests to verify engine disposal behavior.
mmcardle
requested changes
Dec 13, 2025
tests/test_comparer.py
Outdated
Comment on lines
182
to
183
| engine_one.dispose.assert_called_once_with() | ||
| engine_two.dispose.assert_called_once_with() |
Collaborator
There was a problem hiding this comment.
This could both be assert_called_once()
https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.assert_called_once
Owner
Author
There was a problem hiding this comment.
both fixed (there was another pair in another test), thank you for spotting it
- Updated assertions in `test_comparer.py` to use `assert_called_once()` instead of `assert_called_once_with()` for better clarity and consistency in testing engine calls.
- Changed the private attribute for engine disposal from `_dispose_engines` to `__dispose_engines` for better encapsulation. - Updated the disposal logic in the `finally` block to call the renamed `_dispose_engines` method, ensuring proper closure of pooled connections.
- Updated the `db_engine_one` and `db_engine_two` fixtures in `base.py` to use a context manager for engine disposal, ensuring that resources are properly released after use. - Modified the `sqlite_db_engine_one` and `sqlite_db_engine_two` fixtures in `test_comparer.py` similarly to enhance resource management during tests.
Owner
Author
|
@mmcardle final tidy up pushed up :) |
Owner
Author
Thank you man |
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.
@mmcardle
This is a fix in response to #32.
It: