File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 14
14
from datetime import date , datetime , timezone
15
15
from typing import TYPE_CHECKING , NamedTuple
16
16
from unittest import mock
17
- from unittest .mock import MagicMock
18
17
19
18
import pytest
20
19
import pytz
@@ -846,10 +845,11 @@ def test_timeout_query(conn_cnx):
846
845
# we can not precisely control the timing to send cancel query request right after server
847
846
# executes the query but before returning the results back to client
848
847
# it depends on python scheduling and server processing speed, so we mock here
849
- with mock .patch .object (
850
- c , "_timebomb" , new_callable = MagicMock
851
- ) as mock_timerbomb :
852
- mock_timerbomb .executed = True
848
+ with mock .patch (
849
+ "snowflake.connector.cursor._TrackedQueryCancellationTimer" ,
850
+ autospec = True ,
851
+ ) as mock_timebomb :
852
+ mock_timebomb .return_value .executed = True
853
853
c .execute (
854
854
"select 123'" ,
855
855
timeout = 0.1 ,
You can’t perform that action at this time.
0 commit comments