|
PASSED
|
▶
tests/unit/test_unit.py::TestAPIClient::test_client_get
unit
|
0.005s |
1
|
GET
https://api.example.com/items
200
1.9 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/items headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/items 200 (1.9 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {
"id": 1
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAPIClient::test_client_post
unit
|
0.003s |
1
|
POST
https://api.example.com/items
201
1.1 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → POST https://api.example.com/items headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body={'name': 'test'}
09:06:19 [INFO ] pytest_api_core.client: ← POST https://api.example.com/items 201 (1.1 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {
"id": 2
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAPIClient::test_client_resolves_absolute_url
unit
|
0.003s |
1
|
GET
https://other.example.com/data
200
1.1 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://other.example.com/data headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://other.example.com/data 200 (1.1 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
tests/unit/test_unit.py::TestAPIClient::test_client_default_retry_policy
unit
|
0.001s |
0
|
|
PASSED
|
tests/unit/test_unit.py::TestAPIClient::test_client_custom_retry_primitives
unit
|
0.001s |
0
|
|
PASSED
|
tests/unit/test_unit.py::TestAPIClient::test_client_retry_none_disables_retry
unit
|
0.001s |
0
|
|
PASSED
|
tests/unit/test_unit.py::TestAPIClient::test_client_explicit_retry_object_overrides_primitives
unit
|
0.001s |
0
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsHappyPath::test_assertion_status_is
unit
|
0.003s |
1
|
GET
https://api.example.com/ok
200
1.0 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
ASSERTIONS
✅
status_is
expected=200
actual=200
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/ok headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/ok 200 (1.0 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsHappyPath::test_assertion_has_key
unit
|
0.003s |
1
|
GET
https://api.example.com/user
200
0.9 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
{
"id": 1,
"name": "Alice"
}
ASSERTIONS
✅
has_key
key=id
✅
has_key
key=name
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/user headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/user 200 (0.9 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {
"id": 1,
"name": "Alice"
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsHappyPath::test_assertion_json_path
unit
|
0.003s |
1
|
GET
https://api.example.com/user
200
0.9 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
ASSERTIONS
✅
equals
path=$.user.id
expected=42
actual=42
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/user headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/user 200 (0.9 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {
"user": {
"id": 42
}
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsHappyPath::test_assertion_json_path_array
unit
|
0.003s |
1
|
GET
https://api.example.com/items
200
0.8 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
[
{
"id": 1
},
{
"id": 2
}
]
ASSERTIONS
✅
equals
path=$[0].id
expected=1
actual=1
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/items headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/items 200 (0.8 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: [
{
"id": 1
},
{
"id": 2
}
]
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsHappyPath::test_assertion_is_success
unit
|
0.003s |
1
|
GET
https://api.example.com/ok
200
0.9 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/ok headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/ok 200 (0.9 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsHappyPath::test_assertion_response_time_under
unit
|
0.002s |
1
|
GET
https://api.example.com/fast
200
0.8 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
ASSERTIONS
✅
response_time_under
max=10000ms actual=0.8ms
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/fast headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/fast 200 (0.8 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsFailurePaths::test_assertion_status_is_fails
unit
|
0.003s |
1
|
GET
https://api.example.com/bad
404
0.8 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
ASSERTIONS
❌
status_is
expected=200
actual=404
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/bad headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/bad 404 (0.8 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertionsFailurePaths::test_assertion_missing_key_fails
unit
|
0.003s |
1
|
GET
https://api.example.com/user
200
0.9 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/user headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/user 200 (0.9 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {
"id": 1
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_equal_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_equal
expected=hello
actual=hello
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_equal_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_equal
expected=hello
actual=world
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_not_equal_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_not_equal
expected=hello
actual=world
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_not_equal_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_not_equal
expected=hello
actual=hello
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_equal_ignore_case_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_equal_ignore_case
expected=hello
actual=HELLO
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_equal_ignore_case_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_equal_ignore_case
expected=hello
actual=world
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_contains_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_contains
actual=hello world
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_contains_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_contains
actual=hello world
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_matches_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_matches
pattern=^\w+\d+$
actual=abc123
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_matches_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_matches
pattern=^\d+$
actual=abc
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_is_empty_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_is_empty
actual=
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_is_empty_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_is_empty
actual=not empty
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_is_not_empty_passes
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_is_not_empty
actual=not empty
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_is_not_empty_fails
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_is_not_empty
actual=
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_equal_custom_message
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_equal
expected=alice
actual=bob
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_matches_schema_passes
unit
|
0.043s |
0
|
ASSERTIONS
✅
assert_matches_schema
Schema details
SCHEMA
{
"type": "object",
"properties": {
"id": {
"type": "integer"
}
},
"required": [
"id"
]
}
ACTUAL
{
"id": 42
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_matches_schema_fails_with_all_errors
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_matches_schema
2 error(s):
- 'name' is a required property
- 'not-an-int' is not of type 'integer'
Schema details
SCHEMA
{
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
]
}
ACTUAL
{
"id": "not-an-int"
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_matches_schema_custom_message
unit
|
0.001s |
0
|
ASSERTIONS
❌
assert_matches_schema
1 error(s):
- 'id' is a required property
Schema details
SCHEMA
{
"type": "object",
"required": [
"id"
]
}
ACTUAL
{}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAssertUtils::test_assert_matches_schema_sentinel_includes_schema_and_actual
unit
|
0.001s |
0
|
ASSERTIONS
✅
assert_matches_schema
Schema details
SCHEMA
{
"type": "object",
"required": [
"id"
]
}
ACTUAL
{
"id": 1
}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAuthHandlers::test_bearer_auth_injects_header
unit
|
0.002s |
1
|
GET
https://api.example.com/secure
200
0.8 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/secure headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/secure 200 (0.8 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestAuthHandlers::test_api_key_header_auth
unit
|
0.002s |
1
|
GET
https://api.example.com/secure
200
0.8 ms
▶
Req Headers
Req Body
Res Headers
Res Body
| Header | Value |
| User-Agent | python-requests/2.34.2 |
| Accept-Encoding | gzip, deflate |
| Accept | */* |
| Connection | keep-alive |
| Header | Value |
| Content-Type | application/json |
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.client: → GET https://api.example.com/secure headers={'User-Agent': 'python-requests/2.34.2', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'} body=None
09:06:19 [INFO ] pytest_api_core.client: ← GET https://api.example.com/secure 200 (0.8 ms)
09:06:19 [DEBUG ] pytest_api_core.client: response body: {}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_defaults_only
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [WARNING ] pytest_api_core.config: No api_settings_module configured — using defaults only
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='nonexistent': {'base_url': 'http://localhost', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 3, 'api_retry_backoff_factor': 0.3, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_loads_yaml
unit
|
0.002s |
0
|
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='test': {'base_url': 'https://test.example.com', 'timeout': 60, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 3, 'api_retry_backoff_factor': 0.3, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_env_var_override
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='dev': {'base_url': 'https://override.example.com', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 3, 'api_retry_backoff_factor': 0.3, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_retry_defaults
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [WARNING ] pytest_api_core.config: No api_settings_module configured — using defaults only
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='nonexistent': {'base_url': 'http://localhost', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 3, 'api_retry_backoff_factor': 0.3, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_retry_settings_module_override
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='staging': {'base_url': 'http://localhost', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 5, 'api_retry_backoff_factor': 1.0, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_retry_cli_override
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [WARNING ] pytest_api_core.config: No api_settings_module configured — using defaults only
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='nonexistent': {'base_url': 'http://localhost', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 7, 'api_retry_backoff_factor': 0.3, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_retry_env_var_override
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [WARNING ] pytest_api_core.config: No api_settings_module configured — using defaults only
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='nonexistent': {'base_url': 'http://localhost', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 10, 'api_retry_backoff_factor': 2.5, 'api_retry_methods': ['GET', 'POST', 'PUT']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestConfigManager::test_config_retry_env_var_wins_over_cli_and_settings
unit
|
0.001s |
0
|
LOGS
--- Captured log call ---
09:06:19 [WARNING ] pytest_api_core.config: No api_settings_module configured — using defaults only
09:06:19 [DEBUG ] pytest_api_core.config: Loaded config for env='nonexistent': {'base_url': 'http://localhost', 'timeout': 30, 'verify_ssl': True, 'headers': {}, 'api_retry_total': 99, 'api_retry_backoff_factor': 0.3, 'api_retry_methods': ['GET', 'HEAD', 'OPTIONS']}
|
|
PASSED
|
▶
tests/unit/test_unit.py::TestReportPhaseLogging::test_setup_and_teardown_logs_are_captured
unit
|
0.001s |
0
|
LOGS
--- Captured log setup ---
09:06:19 [DEBUG ] pytest_api_core.tests.phase_demo: fixture setup log line
--- Captured log teardown ---
09:06:19 [DEBUG ] pytest_api_core.tests.phase_demo: fixture teardown log line
|