pytest_configure_hook
This module contains the PytestConfiguration class which is used to handle the configuration of a pytest session.
It includes methods to initialize the configuration, get the worker ID, get the number of nodes, and execute the configuration hook.
PytestConfiguration
A class that handles the configuration of a pytest session.
Attributes:
Name | Type | Description |
---|---|---|
logger |
Logger
|
The logging object. |
config |
Config
|
The pytest config object. |
worker_id |
str
|
The worker ID. |
session_store |
SessionStore
|
The session store object. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the PytestConfiguration class. |
__init_configure |
Initializes the configuration. |
worker |
Returns the worker ID. |
nodes |
Returns the number of nodes. |
configure_hook |
Executes the configuration hook. |
Source code in libs\cafex_core\src\cafex_core\utils\hooks_\pytest_configure_hook.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
worker
property
Returns the worker ID.
Returns:
Name | Type | Description |
---|---|---|
str |
The worker ID. |
worker_nodes_count
property
Returns the worker nodes.
Returns:
Name | Type | Description |
---|---|---|
int |
The worker ID. |
__init__(config_)
Initialize the PytestConfiguration class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config_
|
The pytest config object. |
required |
Source code in libs\cafex_core\src\cafex_core\utils\hooks_\pytest_configure_hook.py
33 34 35 36 37 38 39 40 41 42 43 44 |
|
__init_configure()
Initialize the configuration by setting up the necessary components.
Initialize the configuration by setting up the necessary components.
Source code in libs\cafex_core\src\cafex_core\utils\hooks_\pytest_configure_hook.py
46 47 48 49 50 51 52 53 54 55 56 57 |
|
configure_hook()
Executes the configuration hook.
It logs the configuration event, sets the session store attributes, and initializes a defaultdict for the globalDict attribute.
Source code in libs\cafex_core\src\cafex_core\utils\hooks_\pytest_configure_hook.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|