File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ def _set_connection_type(self, conn_class):
411
411
conn_class = connection_module .Connection
412
412
elif not issubclass (
413
413
conn_class , connection_module .Connection
414
- ) or issubclass (connection_module .AsyncConnection ):
414
+ ) or issubclass (conn_class , connection_module .AsyncConnection ):
415
415
errors ._raise_err (errors .ERR_INVALID_CONN_CLASS )
416
416
self ._connection_type = conn_class
417
417
self ._connection_method = oracledb .connect
Original file line number Diff line number Diff line change @@ -866,6 +866,16 @@ def test_2434_invalid_pool_class(self):
866
866
pool_class = int ,
867
867
)
868
868
869
+ def test_2435_pool_with_connectiontype (self ):
870
+ "2435 - test creating a pool with a subclassed connection type"
871
+
872
+ class MyConnection (oracledb .Connection ):
873
+ pass
874
+
875
+ pool = test_env .get_pool (connectiontype = MyConnection )
876
+ with pool .acquire () as conn :
877
+ self .assertIsInstance (conn , MyConnection )
878
+
869
879
870
880
if __name__ == "__main__" :
871
881
test_env .run_test_cases ()
Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ def _set_connection_type(self, conn_class):
409
409
conn_class = connection_module .Connection
410
410
elif not issubclass (
411
411
conn_class , connection_module .Connection
412
- ) or issubclass (connection_module .AsyncConnection ):
412
+ ) or issubclass (conn_class , connection_module .AsyncConnection ):
413
413
errors ._raise_err (errors .ERR_INVALID_CONN_CLASS )
414
414
self ._connection_type = conn_class
415
415
self ._connection_method = oracledb .connect
You can’t perform that action at this time.
0 commit comments