File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/mock_vws/_requests_mock_server Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -154,15 +154,16 @@ def wrapped(
154154 # library onto PreparedRequest objects - it is not
155155 # in the requests type stubs.
156156 req_kwargs : dict [str , Any ] = getattr (request , "req_kwargs" , {})
157- timeout = req_kwargs .get ("timeout" )
157+ timeout : tuple [float , float ] | float | int | None = req_kwargs .get (
158+ "timeout"
159+ )
158160 # requests allows timeout as a (connect, read)
159161 # tuple. The delay simulates server response
160162 # time, so compare against the read timeout.
161- effective : float | None = None
162163 if isinstance (timeout , tuple ):
163- if isinstance ( timeout [1 ], ( int , float )):
164- effective = float ( timeout [ 1 ])
165- elif isinstance (timeout , (int , float )):
164+ timeout = timeout [1 ]
165+ effective : float | None = None
166+ if isinstance (timeout , (int , float )):
166167 effective = float (timeout )
167168
168169 if effective is not None and delay_seconds > effective :
You can’t perform that action at this time.
0 commit comments