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
ratioargument.
-
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
ratioargument.
-
with_fixed_datetime(fixed_datetime)[source] Context manager to set a fixed datetime for the duration of the
withblock.- Parameters
fixed_datetime (
datetime)
See also
The
fixed_datetimefixture.Attention
The monkeypatching only works when datetime is used and imported like:
import datetime print(datetime.datetime.now())
Using
from datetime import datetimewon’t work.- Return type