coincidence.utils
Test helper utilities.
Functions:
|
Returns an iterator of strings, integers and booleans which should be considered |
|
Returns an iterator of strings, integers and booleans which should be considered |
Returns whether the current Python instance is running in Docker. |
|
|
Context manager to set a fixed datetime for the duration of the |
-
generate_truthy_values
(extra_truthy=(), ratio=1)[source] Returns an iterator of strings, integers and booleans which should be considered
True
.Optionally, a random selection of the values can be returned using the
ratio
argument.
-
generate_falsy_values
(extra_falsy=(), ratio=1)[source] Returns an iterator of strings, integers and booleans which should be considered
False
.Optionally, a random selection of the values can be returned using the
ratio
argument.
-
with_fixed_datetime
(fixed_datetime)[source] Context manager to set a fixed datetime for the duration of the
with
block.- Parameters
fixed_datetime (
datetime
)
See also
The
fixed_datetime
fixture.Attention
The monkeypatching only works when datetime is used and imported like:
import datetime print(datetime.datetime.now())
Using
from datetime import datetime
won’t work.- Return type