(iterable, timeout=5)
| 5095 | |
| 5096 | |
| 5097 | def _list_with_timeout(iterable, timeout=5): |
| 5098 | # If the cache lock is never released, iterating blocks forever instead |
| 5099 | # of raising. Iterate in a background thread so the test fails after |
| 5100 | # ``timeout`` seconds instead of hanging the suite. |
| 5101 | result = [] |
| 5102 | thread = threading.Thread( |
| 5103 | target=result.extend, args=(iterable,), daemon=True |
| 5104 | ) |
| 5105 | thread.start() |
| 5106 | thread.join(timeout) |
| 5107 | assert not thread.is_alive(), "Iteration did not finish" |
| 5108 | return result |
| 5109 | |
| 5110 | |
| 5111 | def test_cached_rrule_iterators_started_before_cache_complete(): |
no outgoing calls
no test coverage detected