1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Files
apache/test/pyhttpd_vs_pytest_suite.txt
2026-08-21 08:10:10 +00:00

38 lines
1.8 KiB
Plaintext

pyhttpd vs apache_pytest — framework comparison
Configuration. pyhttpd reads a config.ini file generated by autoconf, with
paths filled in from @prefix@, @bindir@, etc. apache_pytest takes everything
from pytest CLI options (--httpd, --apxs, --conf).
Server lifecycle. pyhttpd starts and stops a separate httpd per test package.
Each package subclasses HttpdTestSetup/HttpdTestEnv and controls its own server
via apachectl. apache_pytest runs a single shared httpd for the entire session,
managed directly without apachectl.
Module loading. In pyhttpd, each test package declares the modules it needs in
its *TestSetup subclass using add_modules(). In apache_pytest, a single config
probes the installed httpd at startup and loads all available modules.
HTTP client. pyhttpd tests call curl, nghttp, and h2load as external
subprocesses. apache_pytest uses httpx, a Python HTTP library running
in-process.
SSL and certificates. pyhttpd generates certificates using the cryptography
and pyopenssl Python libraries. apache_pytest has its own sslca.py that shells
out to the OpenSSL CLI.
Test structure. pyhttpd test packages each have their own env.py with a
subclass of HttpdTestEnv and a per-package conftest.py that sets up and tears
down the server. apache_pytest tests are flat files using shared session-scoped
fixtures (http, config, server) and declarative need_module markers.
Config customization. pyhttpd injects directives via add_httpd_conf() and
copies template files from source directories. apache_pytest uses a
template-based t/conf/httpd.conf with IfModule guards and .htaccess files.
External tool dependencies. pyhttpd requires curl, nghttp, and h2load on
PATH. apache_pytest has no external tool dependencies beyond Python packages.
Port assignment. pyhttpd uses fixed ports defined in config.ini (5001-5100).
apache_pytest assigns ports dynamically.