File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1527,6 +1527,19 @@ def test_con_string_import_error(self):
1527
1527
with pytest .raises (ImportError , match = "SQLAlchemy" ):
1528
1528
sql .read_sql ("SELECT * FROM iris" , conn )
1529
1529
1530
+ @pytest .mark .skipif (SQLALCHEMY_INSTALLED , reason = "SQLAlchemy is installed" )
1531
+ def test_con_unknown_dbapi2_class_does_not_error_without_sql_alchemy_installed (self ):
1532
+
1533
+ class MockSqliteConnection ():
1534
+ def __init__ (self , * args , ** kwargs ):
1535
+ self .conn = sqlite3 .Connection (* args , ** kwargs )
1536
+
1537
+ def __getattr__ (self , name ):
1538
+ return getattr (self .conn , name )
1539
+
1540
+ conn = MockSqliteConnection (":memory:" )
1541
+ sql .read_sql ("SELECT 1" , conn )
1542
+
1530
1543
def test_read_sql_delegate (self ):
1531
1544
iris_frame1 = sql .read_sql_query ("SELECT * FROM iris" , self .conn )
1532
1545
iris_frame2 = sql .read_sql ("SELECT * FROM iris" , self .conn )
You can’t perform that action at this time.
0 commit comments