REFACTOR: Change pytests to use temp tables (starting with #) #79
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.
Summary
This pull request updates the test cases to use temporary tables (prefixed with
#) instead of permanent tables for improved isolation and to prevent unintended side effects during test execution. The changes span across multiple test functions in thetests/test_003_connection.pyandtests/test_004_cursor.pyfiles.Transition to Temporary Tables
Updated all test cases in
tests/test_003_connection.pyto use temporary tables (e.g.,#pytest_test_autocommit,#pytest_test_commit,#pytest_test_rollback) instead of permanent tables. This includes changes in table creation, data insertion, selection, and cleanup steps. [1] [2]Modified the
TEST_TABLEdefinition intests/test_004_cursor.pyto create a temporary table#pytest_all_data_typesinstead of a permanent one.Updated various test cases in
tests/test_004_cursor.py(e.g.,test_insert_id_column,test_insert_bit_column,test_insert_nvarchar_column,test_insert_date_column,test_insert_real_column) to use temporary tables (#pytest_single_column) for creating, inserting, and querying data. This ensures better test isolation and cleanup. [1] [2]Issue Reference
Fixes AB#34163
Checklist
Testing Performed