https://github.com/studioj/wait_for_it
a python package which waits for a certain result to be there
https://github.com/studioj/wait_for_it
python tooling wait
Last synced: 11 months ago
JSON representation
a python package which waits for a certain result to be there
- Host: GitHub
- URL: https://github.com/studioj/wait_for_it
- Owner: studioj
- License: gpl-3.0
- Created: 2019-05-12T16:29:07.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-12-07T08:42:46.000Z (over 1 year ago)
- Last Synced: 2025-05-15T04:11:18.669Z (12 months ago)
- Topics: python, tooling, wait
- Language: Python
- Size: 122 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
### waitforit
| What | Badges |
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Code and Test Quality | [](https://codecov.io/gh/studioj/wait_for_it) [](https://www.codacy.com/manual/studioj/wait_for_it?utm_source=github.com&utm_medium=referral&utm_content=studioj/wait_for_it&utm_campaign=Badge_Grade) [](https://www.codefactor.io/repository/github/studioj/wait_for_it) |
| SonarQube | [](https://sonarcloud.io/dashboard?id=studioj_wait_for_it) [](https://sonarcloud.io/dashboard?id=studioj_wait_for_it) [](https://sonarcloud.io/dashboard?id=studioj_wait_for_it) [](https://sonarcloud.io/dashboard?id=studioj_wait_for_it) |
| PyPI |  |
This is a library for letting your python code wait for a certain action to complete
short example
Given these functions
```python
import wait_for_it_to
def foo():
return True
def bar(param):
x = param
return False
```
This would immediatly return
```python
>> wait_for_it_to.be_true(foo)
>>
```
You can also pass parameters as a list
```python
>> wait_for_it_to.be_true(bar, args=[1])
Traceback (most recent call last):
File "", line 1, in
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
```python
>> wait_for_it_to.be_true(foo, timeout=5)
```
Quite similar you have the functionality
```python
>> 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