ANTA Settings
anta.settings
¶
Settings for ANTA.
DEFAULT_HTTPX_TRUST_ENV
module-attribute
¶
DEFAULT_HTTPX_TRUST_ENV = True
Default value for the trust_env parameter of the HTTPX client.
DEFAULT_MAX_CONCURRENCY
module-attribute
¶
DEFAULT_MAX_CONCURRENCY = 50000
Default value for the maximum number of concurrent tests in the event loop.
DEFAULT_NOFILE
module-attribute
¶
DEFAULT_NOFILE = 16384
Default value for the maximum number of open file descriptors for the ANTA process.
AntaHttpxSettings
¶
Bases: BaseSettings
Environment variables for configuring the ANTA HTTPX client.
When initialized, relevant environment variables are loaded. If not set, default values are used.
Attributes:
| Name | Type | Description |
|---|---|---|
trust_env |
bool
|
Environment variable: ANTA_HTTPX_TRUST_ENV Set to False to disable the use of environment variables by the HTTPX client. Defaults to True. |
AntaRunnerSettings
¶
Bases: BaseSettings
Environment variables for configuring the ANTA runner.
When initialized, relevant environment variables are loaded. If not set, default values are used.
On POSIX systems, also adjusts the process soft limit based on the ANTA_NOFILE environment variable
while respecting the system hard limit, meaning the new soft limit cannot exceed the system’s hard limit.
On non-POSIX systems (Windows), sets the limit to sys.maxsize.
The adjusted limit is available with the file_descriptor_limit property after initialization.
Attributes:
| Name | Type | Description |
|---|---|---|
nofile |
PositiveInt
|
Environment variable: ANTA_NOFILE The maximum number of open file descriptors for the ANTA process. Defaults to 16384. |
max_concurrency |
PositiveInt
|
Environment variable: ANTA_MAX_CONCURRENCY The maximum number of concurrent tests that can run in the event loop. Defaults to 50000. |
file_descriptor_limit
property
¶
file_descriptor_limit: PositiveInt
The maximum number of file descriptors available to the process.
set_and_compute_file_descriptor_limit
¶
set_and_compute_file_descriptor_limit() -> (
AntaRunnerSettings
)
Execute the system call to set the file descriptor limit and computes the effective limit.
Source code in anta/settings.py
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 | |
get_httpx_settings
cached
¶
get_httpx_settings() -> AntaHttpxSettings
Return the cached ANTA HTTPX settings loaded from environment variables.
Returns:
| Type | Description |
|---|---|
AntaHttpxSettings
|
The HTTPX settings instance populated from |
Raises:
| Type | Description |
|---|---|
ValueError
|
If any |
Source code in anta/settings.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |