Skip to content

Testing Guide

github-actions[bot] edited this page Oct 28, 2026 · 9 revisions

Testing Guide

Running the tests

uv run pytest                                   # unit tests, with an 80% coverage floor
uv run pytest tests/unit/test_config.py -k env  # a subset
RUN_INTEGRATION=1 uv run pytest -m integration  # integration tests (real external systems)

CI runs the unit tests on every supported Python version, together with ruff, mypy (strict), the wiki checks and the manifest checks. All of them block a merge.

Test layout

Path What goes there
tests/unit/ Fast and offline: no network, no real external systems. Most tests.
tests/integration/ Real dependencies, marked @pytest.mark.integration; skipped unless RUN_INTEGRATION=1
tests/conftest.py Shared fixtures: clean_env (no MITM_PROXY_* leakage), write_config

Writing tests

  • Every behaviour change needs a test that fails without it. A bug fix starts with the failing test.
  • Assert outcomes (outputs, side effects, errors), not internal calls.
  • Use placeholders for anything that looks real: example.org, 192.0.2.0/24, fake tokens.
  • Don't lower the coverage floor or skip a test to make CI pass.

mitm-proxy

GitHub • Releases


📚 Getting Started

📖 Core Concepts

🔧 Configuration

🔒 Security

🆘 Help & Support

🧑‍💻 For Developers


🔑 Key Features

  • 🔍 Intercept only the hosts you list; tunnel the rest untouched
  • 🔀 HTTP/1.1 and HTTP/2 on both sides, bridged
  • 🧩 Python middleware: inspect, rewrite, answer or deny
  • 🔐 Its own root CA; origins always verified
  • 📈 Prometheus metrics and a read-only status API

🔗 Quick Links

Clone this wiki locally