Skip to content

Commit d6983a0

Browse files
committed
add error handling to scope test cleanup
1 parent b3220b7 commit d6983a0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/scopes_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,9 @@ func TestScopesWithSubqueries(t *testing.T) {
526526
// Helper function to set up test data for scope tests
527527
func setupScopeTestData(t *testing.T) {
528528
// Clean up any existing data
529-
DB.Exec("DELETE FROM users WHERE \"name\" LIKE 'ScopeUser%'")
529+
if err := DB.Where("\"name\" LIKE ?", "ScopeUser%").Delete(&User{}).Error; err != nil {
530+
t.Logf("Warning: Cleanup failed: %v", err)
531+
}
530532

531533
// Create test users
532534
users := []*User{

0 commit comments

Comments
 (0)