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
@@ -796,10 +795,11 @@ def test_timeout_query(conn_cnx):
796
795
# we can not precisely control the timing to send cancel query request right after server
797
796
# executes the query but before returning the results back to client
798
797
# it depends on python scheduling and server processing speed, so we mock here
799
- with mock .patch .object (
800
- c , "_timebomb" , new_callable = MagicMock
801
- ) as mock_timerbomb :
802
- mock_timerbomb .executed = True
798
+ with mock .patch (
799
+ "snowflake.connector.cursor._TrackedQueryCancellationTimer" ,
800
+ autospec = True ,
801
+ ) as mock_timebomb :
802
+ mock_timebomb .return_value .executed = True
803
803
c .execute (
804
804
"select 123'" ,
805
805
timeout = 0.1 ,
You can’t perform that action at this time.
0 commit comments