1 |
commit: 5aec68724c4be3f94d78445a03c1f906da387c89 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 20 14:18:39 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 20 14:20:21 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5aec6872 |
7 |
|
8 |
dev-python/async_timeout: Remove old |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/async_timeout/Manifest | 2 - |
13 |
.../async_timeout/async_timeout-3.0.1.ebuild | 37 -- |
14 |
.../async_timeout/async_timeout-4.0.1.ebuild | 38 -- |
15 |
.../files/async_timeout-3.0.1-fix-py3.10.patch | 387 --------------------- |
16 |
4 files changed, 464 deletions(-) |
17 |
|
18 |
diff --git a/dev-python/async_timeout/Manifest b/dev-python/async_timeout/Manifest |
19 |
index 093108feba67..d2f3d5fd58b2 100644 |
20 |
--- a/dev-python/async_timeout/Manifest |
21 |
+++ b/dev-python/async_timeout/Manifest |
22 |
@@ -1,3 +1 @@ |
23 |
-DIST async-timeout-3.0.1.tar.gz 9724 BLAKE2B f18ae75969b7048469fe22949f25ea25da3fdbf08b98a16b5d5ffe823060a75e6de9ed764727e08d4344c79426e9c89013d49522f20ed62e6fbe912b5c7a8787 SHA512 fd30842671a79edfd52c7350e7fb2120533a6d97b44975f7b071ce2cbde43443bd5bbe1f2ad0ad3ab2156e1987b9e58e0c149b0ecfea8674eb0cb78eee79c986 |
24 |
-DIST async-timeout-4.0.1.tar.gz 8030 BLAKE2B 73bb3f38d33608d120a0d633231bc781b9b5530d80a08c98370ab9100486bda5fd9d7a68ae6b16315bf306a75690897d724fa5db318847803bc445074908e650 SHA512 24a72daf9e0737d0be351a35ff28242dea735bed33f06d9865a71983b1341693c80856c0668d6a485bccc8cf7b9adde33fa904e94bf4730e4a678216e572d119 |
25 |
DIST async-timeout-4.0.2.tar.gz 8221 BLAKE2B ebcb2ef956590e265bbdecc223a877e7260750aecf5b631c6af1f335ce57b51579467901e2344bfa8495010eb1e6e7a39adfd4b6311483d63e0674221888d1f7 SHA512 e9884a525b99bc1a3a15c958a1dbb25a92cb286bb7360b03b0be3198e61685970628c8fef6dc478beba3f031e0ff6f03b1fcc3c2c34032d7fea6f8b65850ac38 |
26 |
|
27 |
diff --git a/dev-python/async_timeout/async_timeout-3.0.1.ebuild b/dev-python/async_timeout/async_timeout-3.0.1.ebuild |
28 |
deleted file mode 100644 |
29 |
index 72fa7f086448..000000000000 |
30 |
--- a/dev-python/async_timeout/async_timeout-3.0.1.ebuild |
31 |
+++ /dev/null |
32 |
@@ -1,37 +0,0 @@ |
33 |
-# Copyright 1999-2021 Gentoo Authors |
34 |
-# Distributed under the terms of the GNU General Public License v2 |
35 |
- |
36 |
-EAPI=7 |
37 |
- |
38 |
-PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
39 |
- |
40 |
-inherit distutils-r1 |
41 |
- |
42 |
-MY_P=${PN/_/-}-${PV} |
43 |
-DESCRIPTION="Timeout context manager for asyncio programs" |
44 |
-HOMEPAGE="https://github.com/aio-libs/async-timeout" |
45 |
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz" |
46 |
-S=${WORKDIR}/${MY_P} |
47 |
- |
48 |
-LICENSE="Apache-2.0" |
49 |
-SLOT="0" |
50 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv sparc x86 ~x64-macos" |
51 |
- |
52 |
-BDEPEND=" |
53 |
- dev-python/setuptools_scm[${PYTHON_USEDEP}] |
54 |
- test? ( |
55 |
- dev-python/pytest-aiohttp[${PYTHON_USEDEP}] |
56 |
- dev-python/pytest-asyncio[${PYTHON_USEDEP}] |
57 |
- )" |
58 |
- |
59 |
-PATCHES=( "${FILESDIR}/${P}-fix-py3.10.patch" ) |
60 |
- |
61 |
-distutils_enable_tests pytest |
62 |
- |
63 |
-python_prepare_all() { |
64 |
- # remove pointless dep on pytest-cov |
65 |
- sed -i -e '/addopts/d' setup.cfg || die |
66 |
- # tests fail due to missing fixture when trying to load this file |
67 |
- rm tests/conftest.py || die |
68 |
- distutils-r1_python_prepare_all |
69 |
-} |
70 |
|
71 |
diff --git a/dev-python/async_timeout/async_timeout-4.0.1.ebuild b/dev-python/async_timeout/async_timeout-4.0.1.ebuild |
72 |
deleted file mode 100644 |
73 |
index deb375553838..000000000000 |
74 |
--- a/dev-python/async_timeout/async_timeout-4.0.1.ebuild |
75 |
+++ /dev/null |
76 |
@@ -1,38 +0,0 @@ |
77 |
-# Copyright 1999-2021 Gentoo Authors |
78 |
-# Distributed under the terms of the GNU General Public License v2 |
79 |
- |
80 |
-EAPI=8 |
81 |
- |
82 |
-PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
83 |
-inherit distutils-r1 |
84 |
- |
85 |
-MY_P=${PN/_/-}-${PV} |
86 |
-DESCRIPTION="Timeout context manager for asyncio programs" |
87 |
-HOMEPAGE="https://github.com/aio-libs/async-timeout" |
88 |
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz" |
89 |
-S=${WORKDIR}/${MY_P} |
90 |
- |
91 |
-LICENSE="Apache-2.0" |
92 |
-SLOT="0" |
93 |
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv sparc x86 ~x64-macos" |
94 |
- |
95 |
-RDEPEND=" |
96 |
- dev-python/typing-extensions[${PYTHON_USEDEP}]" |
97 |
-BDEPEND=" |
98 |
- dev-python/setuptools_scm[${PYTHON_USEDEP}] |
99 |
- test? ( |
100 |
- dev-python/pytest-aiohttp[${PYTHON_USEDEP}] |
101 |
- dev-python/pytest-asyncio[${PYTHON_USEDEP}] |
102 |
- )" |
103 |
- |
104 |
-distutils_enable_tests pytest |
105 |
- |
106 |
-python_prepare_all() { |
107 |
- # remove pointless dep on pytest-cov |
108 |
- sed -i -e '/addopts/d' setup.cfg || die |
109 |
- distutils-r1_python_prepare_all |
110 |
-} |
111 |
- |
112 |
-python_test() { |
113 |
- epytest -p no:aiohttp |
114 |
-} |
115 |
|
116 |
diff --git a/dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch b/dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch |
117 |
deleted file mode 100644 |
118 |
index 5bfdcf2e6dab..000000000000 |
119 |
--- a/dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch |
120 |
+++ /dev/null |
121 |
@@ -1,387 +0,0 @@ |
122 |
-diff --git a/tests/test_py35.py b/tests/test_py35.py |
123 |
-index 00bb7f0..7d88d99 100644 |
124 |
---- a/tests/test_py35.py |
125 |
-+++ b/tests/test_py35.py |
126 |
-@@ -4,30 +4,32 @@ import pytest |
127 |
- |
128 |
- from async_timeout import timeout |
129 |
- |
130 |
--pytestmark = pytest.mark.asyncio |
131 |
- |
132 |
-- |
133 |
--async def test_async_timeout(loop): |
134 |
-+@×××××××××××.asyncio |
135 |
-+async def test_async_timeout(): |
136 |
- with pytest.raises(asyncio.TimeoutError): |
137 |
-- async with timeout(0.01, loop=loop) as cm: |
138 |
-- await asyncio.sleep(10, loop=loop) |
139 |
-+ async with timeout(0.01) as cm: |
140 |
-+ await asyncio.sleep(10) |
141 |
- assert cm.expired |
142 |
- |
143 |
- |
144 |
--async def test_async_no_timeout(loop): |
145 |
-- async with timeout(1, loop=loop) as cm: |
146 |
-- await asyncio.sleep(0, loop=loop) |
147 |
-+@×××××××××××.asyncio |
148 |
-+async def test_async_no_timeout(): |
149 |
-+ async with timeout(1) as cm: |
150 |
-+ await asyncio.sleep(0) |
151 |
- assert not cm.expired |
152 |
- |
153 |
- |
154 |
--async def test_async_zero(loop): |
155 |
-+@×××××××××××.asyncio |
156 |
-+async def test_async_zero(): |
157 |
- with pytest.raises(asyncio.TimeoutError): |
158 |
-- async with timeout(0, loop=loop) as cm: |
159 |
-- await asyncio.sleep(10, loop=loop) |
160 |
-+ async with timeout(0) as cm: |
161 |
-+ await asyncio.sleep(10) |
162 |
- assert cm.expired |
163 |
- |
164 |
- |
165 |
--async def test_async_zero_coro_not_started(loop): |
166 |
-+@×××××××××××.asyncio |
167 |
-+async def test_async_zero_coro_not_started(): |
168 |
- coro_started = False |
169 |
- |
170 |
- async def coro(): |
171 |
-@@ -35,8 +37,8 @@ async def test_async_zero_coro_not_started(loop): |
172 |
- coro_started = True |
173 |
- |
174 |
- with pytest.raises(asyncio.TimeoutError): |
175 |
-- async with timeout(0, loop=loop) as cm: |
176 |
-- await asyncio.sleep(0, loop=loop) |
177 |
-+ async with timeout(0) as cm: |
178 |
-+ await asyncio.sleep(0) |
179 |
- await coro() |
180 |
- |
181 |
- assert cm.expired |
182 |
-diff --git a/tests/test_timeout.py b/tests/test_timeout.py |
183 |
-index 8915546..b1cb3c7 100644 |
184 |
---- a/tests/test_timeout.py |
185 |
-+++ b/tests/test_timeout.py |
186 |
-@@ -6,89 +6,69 @@ import pytest |
187 |
- |
188 |
- from async_timeout import timeout |
189 |
- |
190 |
--from asyncio import ensure_future |
191 |
-- |
192 |
-- |
193 |
--def create_future(loop): |
194 |
-- """Compatibility wrapper for the loop.create_future() call introduced in |
195 |
-- 3.5.2.""" |
196 |
-- if hasattr(loop, 'create_future'): |
197 |
-- return loop.create_future() |
198 |
-- else: |
199 |
-- return asyncio.Future(loop=loop) |
200 |
-- |
201 |
- |
202 |
- @pytest.mark.asyncio |
203 |
--async def test_timeout(loop): |
204 |
-+async def test_timeout(): |
205 |
- canceled_raised = False |
206 |
- |
207 |
- async def long_running_task(): |
208 |
- try: |
209 |
-- await asyncio.sleep(10, loop=loop) |
210 |
-+ await asyncio.sleep(10) |
211 |
- except asyncio.CancelledError: |
212 |
- nonlocal canceled_raised |
213 |
- canceled_raised = True |
214 |
- raise |
215 |
- |
216 |
- with pytest.raises(asyncio.TimeoutError): |
217 |
-- with timeout(0.01, loop=loop) as t: |
218 |
-+ with timeout(0.01) as t: |
219 |
- await long_running_task() |
220 |
-- assert t._loop is loop |
221 |
-+ assert t._loop is asyncio.get_event_loop() |
222 |
- assert canceled_raised, 'CancelledError was not raised' |
223 |
- |
224 |
- |
225 |
- @pytest.mark.asyncio |
226 |
--async def test_timeout_finish_in_time(loop): |
227 |
-+async def test_timeout_finish_in_time(): |
228 |
- async def long_running_task(): |
229 |
-- await asyncio.sleep(0.01, loop=loop) |
230 |
-+ await asyncio.sleep(0.01) |
231 |
- return 'done' |
232 |
- |
233 |
-- with timeout(0.1, loop=loop): |
234 |
-+ with timeout(0.1): |
235 |
- resp = await long_running_task() |
236 |
- assert resp == 'done' |
237 |
- |
238 |
- |
239 |
--def test_timeout_global_loop(loop): |
240 |
-- asyncio.set_event_loop(loop) |
241 |
-- |
242 |
-- async def run(): |
243 |
-- with timeout(10) as t: |
244 |
-- await asyncio.sleep(0.01) |
245 |
-- assert t._loop is loop |
246 |
-- |
247 |
-- loop.run_until_complete(run()) |
248 |
-- |
249 |
-- |
250 |
- @pytest.mark.asyncio |
251 |
--async def test_timeout_disable(loop): |
252 |
-+async def test_timeout_disable(): |
253 |
- async def long_running_task(): |
254 |
-- await asyncio.sleep(0.1, loop=loop) |
255 |
-+ await asyncio.sleep(0.1) |
256 |
- return 'done' |
257 |
- |
258 |
-+ loop = asyncio.get_event_loop() |
259 |
- t0 = loop.time() |
260 |
-- with timeout(None, loop=loop): |
261 |
-+ with timeout(None): |
262 |
- resp = await long_running_task() |
263 |
- assert resp == 'done' |
264 |
- dt = loop.time() - t0 |
265 |
- assert 0.09 < dt < 0.13, dt |
266 |
- |
267 |
- |
268 |
--def test_timeout_is_none_no_task(loop): |
269 |
-+def test_timeout_is_none_no_task(): |
270 |
-+ loop = asyncio.get_event_loop() |
271 |
- with timeout(None, loop=loop) as cm: |
272 |
- assert cm._task is None |
273 |
- |
274 |
- |
275 |
- @pytest.mark.asyncio |
276 |
--async def test_timeout_enable_zero(loop): |
277 |
-+async def test_timeout_enable_zero(): |
278 |
- with pytest.raises(asyncio.TimeoutError): |
279 |
-- with timeout(0, loop=loop) as cm: |
280 |
-- await asyncio.sleep(0.1, loop=loop) |
281 |
-+ with timeout(0) as cm: |
282 |
-+ await asyncio.sleep(0.1) |
283 |
- |
284 |
- assert cm.expired |
285 |
- |
286 |
- |
287 |
- @pytest.mark.asyncio |
288 |
--async def test_timeout_enable_zero_coro_not_started(loop): |
289 |
-+async def test_timeout_enable_zero_coro_not_started(): |
290 |
- coro_started = False |
291 |
- |
292 |
- async def coro(): |
293 |
-@@ -96,8 +76,8 @@ async def test_timeout_enable_zero_coro_not_started(loop): |
294 |
- coro_started = True |
295 |
- |
296 |
- with pytest.raises(asyncio.TimeoutError): |
297 |
-- with timeout(0, loop=loop) as cm: |
298 |
-- await asyncio.sleep(0, loop=loop) |
299 |
-+ with timeout(0) as cm: |
300 |
-+ await asyncio.sleep(0) |
301 |
- await coro() |
302 |
- |
303 |
- assert cm.expired |
304 |
-@@ -105,51 +85,52 @@ async def test_timeout_enable_zero_coro_not_started(loop): |
305 |
- |
306 |
- |
307 |
- @pytest.mark.asyncio |
308 |
--async def test_timeout_not_relevant_exception(loop): |
309 |
-- await asyncio.sleep(0, loop=loop) |
310 |
-+async def test_timeout_not_relevant_exception(): |
311 |
-+ await asyncio.sleep(0) |
312 |
- with pytest.raises(KeyError): |
313 |
-- with timeout(0.1, loop=loop): |
314 |
-+ with timeout(0.1): |
315 |
- raise KeyError |
316 |
- |
317 |
- |
318 |
- @pytest.mark.asyncio |
319 |
--async def test_timeout_canceled_error_is_not_converted_to_timeout(loop): |
320 |
-- await asyncio.sleep(0, loop=loop) |
321 |
-+async def test_timeout_canceled_error_is_not_converted_to_timeout(): |
322 |
-+ await asyncio.sleep(0) |
323 |
- with pytest.raises(asyncio.CancelledError): |
324 |
-- with timeout(0.001, loop=loop): |
325 |
-+ with timeout(0.001): |
326 |
- raise asyncio.CancelledError |
327 |
- |
328 |
- |
329 |
- @pytest.mark.asyncio |
330 |
--async def test_timeout_blocking_loop(loop): |
331 |
-+async def test_timeout_blocking_loop(): |
332 |
- async def long_running_task(): |
333 |
- time.sleep(0.1) |
334 |
- return 'done' |
335 |
- |
336 |
-- with timeout(0.01, loop=loop): |
337 |
-+ with timeout(0.01): |
338 |
- result = await long_running_task() |
339 |
- assert result == 'done' |
340 |
- |
341 |
- |
342 |
- @pytest.mark.asyncio |
343 |
--async def test_for_race_conditions(loop): |
344 |
-- fut = create_future(loop) |
345 |
-+async def test_for_race_conditions(): |
346 |
-+ loop = asyncio.get_event_loop() |
347 |
-+ fut = loop.create_future() |
348 |
- loop.call_later(0.1, fut.set_result('done')) |
349 |
-- with timeout(0.2, loop=loop): |
350 |
-+ with timeout(0.2): |
351 |
- resp = await fut |
352 |
- assert resp == 'done' |
353 |
- |
354 |
- |
355 |
- @pytest.mark.asyncio |
356 |
--async def test_timeout_time(loop): |
357 |
-+async def test_timeout_time(): |
358 |
- foo_running = None |
359 |
-- |
360 |
-+ loop = asyncio.get_event_loop() |
361 |
- start = loop.time() |
362 |
- with pytest.raises(asyncio.TimeoutError): |
363 |
-- with timeout(0.1, loop=loop): |
364 |
-+ with timeout(0.1): |
365 |
- foo_running = True |
366 |
- try: |
367 |
-- await asyncio.sleep(0.2, loop=loop) |
368 |
-+ await asyncio.sleep(0.2) |
369 |
- finally: |
370 |
- foo_running = False |
371 |
- |
372 |
-@@ -160,26 +141,26 @@ async def test_timeout_time(loop): |
373 |
- assert not foo_running |
374 |
- |
375 |
- |
376 |
--def test_raise_runtimeerror_if_no_task(loop): |
377 |
-+def test_raise_runtimeerror_if_no_task(): |
378 |
- with pytest.raises(RuntimeError): |
379 |
-- with timeout(0.1, loop=loop): |
380 |
-+ with timeout(0.1): |
381 |
- pass |
382 |
- |
383 |
- |
384 |
- @pytest.mark.asyncio |
385 |
--async def test_outer_coro_is_not_cancelled(loop): |
386 |
-+async def test_outer_coro_is_not_cancelled(): |
387 |
- |
388 |
- has_timeout = False |
389 |
- |
390 |
- async def outer(): |
391 |
- nonlocal has_timeout |
392 |
- try: |
393 |
-- with timeout(0.001, loop=loop): |
394 |
-- await asyncio.sleep(1, loop=loop) |
395 |
-+ with timeout(0.001): |
396 |
-+ await asyncio.sleep(1) |
397 |
- except asyncio.TimeoutError: |
398 |
- has_timeout = True |
399 |
- |
400 |
-- task = ensure_future(outer(), loop=loop) |
401 |
-+ task = asyncio.ensure_future(outer()) |
402 |
- await task |
403 |
- assert has_timeout |
404 |
- assert not task.cancelled() |
405 |
-@@ -187,14 +168,15 @@ async def test_outer_coro_is_not_cancelled(loop): |
406 |
- |
407 |
- |
408 |
- @pytest.mark.asyncio |
409 |
--async def test_cancel_outer_coro(loop): |
410 |
-- fut = create_future(loop) |
411 |
-+async def test_cancel_outer_coro(): |
412 |
-+ loop = asyncio.get_event_loop() |
413 |
-+ fut = loop.create_future() |
414 |
- |
415 |
- async def outer(): |
416 |
- fut.set_result(None) |
417 |
-- await asyncio.sleep(1, loop=loop) |
418 |
-+ await asyncio.sleep(1) |
419 |
- |
420 |
-- task = ensure_future(outer(), loop=loop) |
421 |
-+ task = asyncio.ensure_future(outer()) |
422 |
- await fut |
423 |
- task.cancel() |
424 |
- with pytest.raises(asyncio.CancelledError): |
425 |
-@@ -204,57 +186,64 @@ async def test_cancel_outer_coro(loop): |
426 |
- |
427 |
- |
428 |
- @pytest.mark.asyncio |
429 |
--async def test_timeout_suppress_exception_chain(loop): |
430 |
-+async def test_timeout_suppress_exception_chain(): |
431 |
- with pytest.raises(asyncio.TimeoutError) as ctx: |
432 |
-- with timeout(0.01, loop=loop): |
433 |
-- await asyncio.sleep(10, loop=loop) |
434 |
-+ with timeout(0.01): |
435 |
-+ await asyncio.sleep(10) |
436 |
- assert not ctx.value.__suppress_context__ |
437 |
- |
438 |
- |
439 |
- @pytest.mark.asyncio |
440 |
--async def test_timeout_expired(loop): |
441 |
-+async def test_timeout_expired(): |
442 |
- with pytest.raises(asyncio.TimeoutError): |
443 |
-- with timeout(0.01, loop=loop) as cm: |
444 |
-- await asyncio.sleep(10, loop=loop) |
445 |
-+ with timeout(0.01) as cm: |
446 |
-+ await asyncio.sleep(10) |
447 |
- assert cm.expired |
448 |
- |
449 |
- |
450 |
- @pytest.mark.asyncio |
451 |
--async def test_timeout_inner_timeout_error(loop): |
452 |
-+async def test_timeout_inner_timeout_error(): |
453 |
- with pytest.raises(asyncio.TimeoutError): |
454 |
-- with timeout(0.01, loop=loop) as cm: |
455 |
-+ with timeout(0.01) as cm: |
456 |
- raise asyncio.TimeoutError |
457 |
- assert not cm.expired |
458 |
- |
459 |
- |
460 |
- @pytest.mark.asyncio |
461 |
--async def test_timeout_inner_other_error(loop): |
462 |
-+async def test_timeout_inner_other_error(): |
463 |
- with pytest.raises(RuntimeError): |
464 |
-- with timeout(0.01, loop=loop) as cm: |
465 |
-+ with timeout(0.01) as cm: |
466 |
- raise RuntimeError |
467 |
- assert not cm.expired |
468 |
- |
469 |
- |
470 |
- @pytest.mark.asyncio |
471 |
--async def test_timeout_remaining(loop): |
472 |
-- with timeout(None, loop=loop) as cm: |
473 |
-+async def test_timeout_remaining(): |
474 |
-+ with timeout(None) as cm: |
475 |
- assert cm.remaining is None |
476 |
-+ assert cm.remaining is None |
477 |
-+ |
478 |
-+ t = timeout(None) |
479 |
-+ assert t.remaining is None |
480 |
- |
481 |
-- t = timeout(1.0, loop=loop) |
482 |
-+ t = timeout(1.0) |
483 |
- assert t.remaining is None |
484 |
- |
485 |
-- with timeout(1.0, loop=loop) as cm: |
486 |
-- await asyncio.sleep(0.1, loop=loop) |
487 |
-+ with timeout(1.0) as cm: |
488 |
-+ await asyncio.sleep(0.1) |
489 |
- assert cm.remaining < 1.0 |
490 |
-+ r = cm.remaining |
491 |
-+ time.sleep(0.1) |
492 |
-+ assert abs(r - cm.remaining) < 1.0 |
493 |
- |
494 |
- with pytest.raises(asyncio.TimeoutError): |
495 |
-- with timeout(0.1, loop=loop) as cm: |
496 |
-- await asyncio.sleep(0.5, loop=loop) |
497 |
-+ with timeout(0.1) as cm: |
498 |
-+ await asyncio.sleep(0.5) |
499 |
- |
500 |
- assert cm.remaining == 0.0 |
501 |
- |
502 |
- |
503 |
--def test_cancel_without_starting(loop): |
504 |
-- tm = timeout(1, loop=loop) |
505 |
-+def test_cancel_without_starting(): |
506 |
-+ tm = timeout(1) |
507 |
- tm._cancel_task() |
508 |
- tm._cancel_task() # double call should success |