mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-01 21:55:50 +00:00
test: specify exceptions being caught in guardrails_test.py
Before this commit, the test caught a broad `Exception`. This change specifies the expected exceptions to avoid a situation where the product or test is broken and it goes undetected.
This commit is contained in:
@@ -8,6 +8,7 @@ import logging
|
||||
|
||||
import pytest
|
||||
from cassandra.cluster import Session
|
||||
from cassandra.protocol import ConfigurationException, InvalidRequest
|
||||
|
||||
from dtest_class import Tester
|
||||
|
||||
@@ -27,9 +28,9 @@ def create_ks_and_assert_warning(session, query, ks_name, key_warn_msg_words):
|
||||
|
||||
|
||||
def assert_creating_ks_fails(session, query, ks_name):
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(ConfigurationException):
|
||||
session.execute(query)
|
||||
with pytest.raises(Exception):
|
||||
with pytest.raises(InvalidRequest):
|
||||
session.execute(f"USE {ks_name}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user