Commit 9d1ab46 1 parent 455b3d8 commit 9d1ab46 Copy full SHA for 9d1ab46
File tree 1 file changed +3
-3
lines changed
tests/unit_tests/db_engine_specs
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 30
30
String ,
31
31
TypeEngine ,
32
32
)
33
+ from urllib3 .connection import HTTPConnection
34
+ from urllib3 .exceptions import NewConnectionError
33
35
34
36
from superset .utils .core import GenericDataType
35
37
from tests .unit_tests .db_engine_specs .utils import (
@@ -56,14 +58,12 @@ def test_convert_dttm(
56
58
57
59
58
60
def test_execute_connection_error () -> None :
59
- from urllib3 .exceptions import NewConnectionError
60
-
61
61
from superset .db_engine_specs .clickhouse import ClickHouseEngineSpec
62
62
from superset .db_engine_specs .exceptions import SupersetDBAPIDatabaseError
63
63
64
64
cursor = Mock ()
65
65
cursor .execute .side_effect = NewConnectionError (
66
- "Dummypool" , "Exception with sensitive data"
66
+ HTTPConnection ( "localhost" ) , "Exception with sensitive data"
67
67
)
68
68
with pytest .raises (SupersetDBAPIDatabaseError ) as ex :
69
69
ClickHouseEngineSpec .execute (cursor , "SELECT col1 from table1" )
You can’t perform that action at this time.
0 commit comments