Skip to content

Fix failures in tests/test_config_matrix_pytest.py (validate_config TypeError on partial ServerConfig) #17

@MichaelDecent

Description

@MichaelDecent

Summary

tests/test_config_matrix_pytest.py currently fails in this environment due to TypeError raised inside validate_config, and mirrors the same failure pattern already present in tests/test_config_matrix.py.

Reproduction

uv run --with pytest --with pytest-asyncio pytest -q tests/test_config_matrix_pytest.py

Also reproducible in unittest:

uv run python -m unittest -v tests.test_config_matrix

Observed failures

test_config_matrix_pytest.py reports:

  • 6 failed, 3 passed
  • failing cases:
    • test_udp_ssl_is_accepted_for_quic_tls
    • test_udp_client_auth_is_accepted_with_a_trust_store
    • test_udp_client_auth_requires_an_explicit_trust_store
    • test_tcp_client_auth_is_accepted_with_a_trust_store
    • test_tcp_client_auth_requires_an_explicit_trust_store
    • test_invalid_pipe_requires_path

Error signature

validate_config raises:

TypeError: '<=' not supported between instances of 'int' and 'NoneType'

at:

  • src/tigrcorn/config/validate.py:92
  • expression: 16_384 <= config.http.http2_max_frame_size <= 16_777_215

Notes

  • The pytest mirror appears to be behaviorally consistent with current unittest behavior for this module.
  • This looks like validation logic expecting fully-populated HTTP2 defaults, while these tests construct partial ServerConfig(...) instances directly.

Expected behavior

One of:

  1. validate_config should guard http2_max_frame_size for None (and raise ConfigError or normalize defaults), or
  2. tests should build config objects through build_config/normalized defaults when validating listener-specific scenarios.

Acceptance criteria

  • uv run --with pytest --with pytest-asyncio pytest -q tests/test_config_matrix_pytest.py passes (or fails only for intentionally expected exceptions), and
  • uv run python -m unittest -v tests.test_config_matrix is aligned with intended behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions