Utils#
Utility functions.
- saltfactories.utils.random_string(prefix, size=6, uppercase=True, lowercase=True, digits=True)[source]#
Generates a random string.
- Parameters:
prefix (str) – The prefix for the random string
size (int) – The size of the random string
uppercase (bool) – If true, include upper-cased ascii chars in choice sample
lowercase (bool) – If true, include lower-cased ascii chars in choice sample
digits (bool) – If true, include digits in choice sample
- Return str:
The random string
- saltfactories.utils.cast_to_pathlib_path(value)[source]#
Cast the passed value to an instance of
pathlib.Path
.
- saltfactories.utils.warn_until(version, message, category=<class 'DeprecationWarning'>, stacklevel=None, _dont_call_warnings=False, _pkg_version_=None)[source]#
Show a deprecation warning.
Helper function to raise a warning, by default, a
DeprecationWarning
, until the providedversion
, after which, aRuntimeError
will be raised to remind the developers to remove the warning because the target version has been reached.- Parameters:
version (str) – The version string after which the warning becomes a
RuntimeError
. For example2.1
.message (str) – The warning message to be displayed.
category (Type[Warning]) – The warning class to be thrown, by default
DeprecationWarning
stacklevel (int | None) – There should be no need to set the value of
stacklevel
._dont_call_warnings (bool) – This parameter is used just to get the functionality until the actual error is to be issued. When we’re only after the version checks to raise a
RuntimeError
._pkg_version_ (str | None) –
- Return type:
None
- saltfactories.utils.cli_scripts
- saltfactories.utils.functional
- saltfactories.utils.loader
- PyTest Markers related utilities
- Temporary files utilities
- Salt Extensions
get_engines_dirs()
get_log_handlers_dirs()
- PyTest Salt Engine
start()
ext_type_encoder()
PyTestEventForwardClient
PyTestEventForwardClient.connection_made()
PyTestEventForwardClient.connection_lost()
PyTestEventForwardClient.wait_connected()
PyTestEventForwardClient.wait_disconnected()
PyTestEventForwardClient.data_received()
PyTestEventForwardClient.eof_received()
PyTestEventForwardClient.pause_writing()
PyTestEventForwardClient.resume_writing()
PyTestEventForwardEngine
- PyTest Salt Log Handler
setup_handlers()
ZMQHandler
ZMQHandler.setFormatter()
ZMQHandler.start()
ZMQHandler.stop()
ZMQHandler.format()
ZMQHandler.prepare()
ZMQHandler.emit()
ZMQHandler.close()
ZMQHandler.acquire()
ZMQHandler.addFilter()
ZMQHandler.createLock()
ZMQHandler.filter()
ZMQHandler.flush()
ZMQHandler.handle()
ZMQHandler.handleError()
ZMQHandler.release()
ZMQHandler.removeFilter()
ZMQHandler.setLevel()