Skip to content

Commit 90be58b

Browse files
committed
test consolidation
1 parent 2ffa7bd commit 90be58b

7 files changed

+1157
-912
lines changed

tests/integration/test_basic_operations.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
test_crud_operations.py.
77
"""
88

9-
import asyncio
109
import uuid
1110

1211
import pytest
@@ -117,51 +116,3 @@ async def test_error_handling(self, cassandra_session):
117116
await cassandra_session.execute("INVALID SQL QUERY")
118117
# Could be SyntaxException or InvalidRequest depending on driver version
119118
assert "Syntax" in str(exc_info.value) or "Invalid" in str(exc_info.value)
120-
121-
async def test_concurrent_queries(self, cassandra_session):
122-
"""Test executing multiple queries concurrently with proper patterns."""
123-
# Get the unique table name
124-
users_table = cassandra_session._test_users_table
125-
126-
try:
127-
# Prepare statement
128-
insert_stmt = await cassandra_session.prepare(
129-
f"""
130-
INSERT INTO {users_table} (id, name, email, age)
131-
VALUES (?, ?, ?, ?)
132-
"""
133-
)
134-
135-
# Execute multiple queries concurrently
136-
async def insert_user(i: int):
137-
user_id = uuid.uuid4()
138-
try:
139-
await cassandra_session.execute(
140-
insert_stmt, [user_id, f"Concurrent{i}", f"concurrent{i}@example.com", 30]
141-
)
142-
return user_id
143-
except Exception as e:
144-
pytest.fail(f"Failed to insert concurrent user {i}: {e}")
145-
146-
# Insert 20 users concurrently
147-
try:
148-
user_ids = await asyncio.gather(*[insert_user(i) for i in range(20)])
149-
except Exception as e:
150-
pytest.fail(f"Failed concurrent insertion: {e}")
151-
152-
# Verify all were inserted
153-
select_stmt = await cassandra_session.prepare(
154-
f"SELECT * FROM {users_table} WHERE id = ?"
155-
)
156-
157-
for i, user_id in enumerate(user_ids):
158-
try:
159-
result = await cassandra_session.execute(select_stmt, [user_id])
160-
row = result.one()
161-
assert row is not None
162-
assert row.name == f"Concurrent{i}"
163-
except Exception as e:
164-
pytest.fail(f"Failed to verify concurrent user {i}: {e}")
165-
166-
except Exception as e:
167-
pytest.fail(f"Concurrent query test setup failed: {e}")

0 commit comments

Comments
 (0)