Helper library which waits
Project description
waitforit
| What | Badges |
|---|---|
| Code and Test Quality | |
| SonarQube | |
| PyPI |
This is a library for letting your python code wait for a certain action to complete
short example
Given these functions
import wait_for_it_to
def foo():
return True
def bar(param):
x = param
return False
This would immediatly return
>> wait_for_it_to.be_true(foo)
>>
You can also pass parameters as a list
>> wait_for_it_to.be_true(bar, args=[1])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "..\wait_for_it\wait_for_it_to\__init__.py", line 27, in be_true
raise TimeoutError(msg)
TimeoutError: expected something that evaluates to True, but got False instead
You can also pass a timeout value in seconds
>> wait_for_it_to.be_true(foo, timeout=5)
Quite similar you have the functionality
>> wait_for_it_to.be_false(bar, timeout=5, args[1])
>> wait_for_it_to.equal(bar, False, timeout=5, args[1])
>> wait_for_it_to.not_raise_an_exception(bar, timeout=5, RuntimeError)
Version History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wait_for_it_to-0.0.21.tar.gz
(26.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wait_for_it_to-0.0.21.tar.gz.
File metadata
- Download URL: wait_for_it_to-0.0.21.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2449c665da0df0a136f6a875dff110cf5feac3cdac51c69a930fe217eec921b3
|
|
| MD5 |
8b7e3b9c8c4794bd84cd7b88c60ee818
|
|
| BLAKE2b-256 |
3ced3821371cc1941a4e626e3deebca76b3c62aeb959bb0c4c1f0b560901a0e9
|
File details
Details for the file wait_for_it_to-0.0.21-py3-none-any.whl.
File metadata
- Download URL: wait_for_it_to-0.0.21-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4455985af1743b6fa3649bb9119a9e53bb4972160d629bbbdca529db883be747
|
|
| MD5 |
a3d09feeeb3890ebbae839926152fd1d
|
|
| BLAKE2b-256 |
fcede151673d53c420a2a15e974ce3c80f06a6637a3ef505689f1b09419eb7be
|