Skip to content

Conversation

@bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Jun 17, 2025

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 the tests/test_003_connection.py and tests/test_004_cursor.py files.

Transition to Temporary Tables

  • Updated all test cases in tests/test_003_connection.py to 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_TABLE definition in tests/test_004_cursor.py to create a temporary table #pytest_all_data_types instead 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

  • Tests Passed (if applicable)
  • Code is formatted
  • Docs Updated (if necessary)

Testing Performed

  • Unit Tests

Copilot AI review requested due to automatic review settings June 17, 2025 12:23
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 refactors multiple test cases to use temporary tables (with a "#" prefix) to improve test isolation and prevent side effects. Key changes include updating all table creation, insertion, selection, and cleanup statements in both connection and cursor tests.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/test_004_cursor.py Updated table creation and cleanup to use temporary table names.
tests/test_003_connection.py Refactored autocommit, commit, and rollback tests to use temporary tables.

@bewithgaurav bewithgaurav merged commit 1fd6b58 into main Jun 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants