Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RedHatQE/wait_for
Wait utility
https://github.com/RedHatQE/wait_for
Last synced: 13 days ago
JSON representation
Wait utility
- Host: GitHub
- URL: https://github.com/RedHatQE/wait_for
- Owner: RedHatQE
- License: apache-2.0
- Created: 2015-08-28T08:26:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-04T11:13:02.000Z (about 3 years ago)
- Last Synced: 2024-09-19T10:06:15.298Z (about 2 months ago)
- Language: Python
- Size: 65.4 KB
- Stars: 16
- Watchers: 10
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
wait-for
========Introduction
------------Waits for a certain amount of time for an action to complete
Designed to wait for a certain length of time,
either linearly in 1 second steps, or exponentially, up to a maximum.
Returns the output from the function once it completes successfully,
along with the time taken to complete the command... note::
If using the expo keyword, the returned elapsed time will be inaccurate
as wait_for does not know the exact time that the function returned
correctly, only that it returned correctly at last check.Usage
-----.. code-block:: python
from wait_for import wait_for
class Incrementor():
value = 0def i_sleep_a_lot(self):
time.sleep(.1)
self.value += 1
return self.valueincman = Incrementor()
ec, tc = wait_for(incman.i_sleep_a_lot,
fail_condition=0,
delay=.05)
print("Function output {} in time {} ".format(ec, tc))