mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
Add test suite that exercises both PythonProtocol and H1CProtocol implementations with identical test cases using pytest parametrization. Tests cover request line parsing, headers, body handling (Content-Length and chunked), connection handling, parser reset, and callback behavior.
25 lines
747 B
Python
25 lines
747 B
Python
#
|
|
# This file is part of gunicorn released under the MIT license.
|
|
# See the NOTICE for more information.
|
|
|
|
"""Pytest configuration for gunicorn tests."""
|
|
|
|
import os
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
# Add the tests directory to sys.path so test support modules can be imported
|
|
# as 'tests.module_name' (e.g., 'tests.support_dirty_apps:CounterApp')
|
|
tests_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
if tests_dir not in sys.path:
|
|
sys.path.insert(0, tests_dir)
|
|
|
|
|
|
@pytest.fixture(params=["python", "fast"])
|
|
def http_parser(request):
|
|
"""Parametrize tests over ASGI http_parser implementations."""
|
|
if request.param == "fast":
|
|
pytest.importorskip("gunicorn_h1c", reason="gunicorn_h1c required")
|
|
return request.param
|