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 1111from datetime import date , datetime , timezone
1212from typing import TYPE_CHECKING , NamedTuple
1313from unittest import mock
14- from unittest .mock import MagicMock
1514
1615import pytest
1716import pytz
@@ -843,10 +842,11 @@ def test_timeout_query(conn_cnx):
843842 # we can not precisely control the timing to send cancel query request right after server
844843 # executes the query but before returning the results back to client
845844 # it depends on python scheduling and server processing speed, so we mock here
846- with mock .patch .object (
847- c , "_timebomb" , new_callable = MagicMock
848- ) as mock_timerbomb :
849- mock_timerbomb .executed = True
845+ with mock .patch (
846+ "snowflake.connector.cursor._TrackedQueryCancellationTimer" ,
847+ autospec = True ,
848+ ) as mock_timebomb :
849+ mock_timebomb .return_value .executed = True
850850 c .execute (
851851 "select 123'" ,
852852 timeout = 0.1 ,
You can’t perform that action at this time.
0 commit comments