Convert a Postman Collection v2.1 JSON file into a runnable pytest test suite using the postman2pytest CLI. Use when the user has a Postman collection (a .postman_collection.json or v2.1 JSON export) and wants to run it as pytest in CI, when migrating from Postman/Newman to a Python-native test stack, when bridging Postman-documented APIs into a pytest-based regression suite, when the user asks to generate pytest tests from Postman, or when the user mentions wanting to keep Postman as the source of truth but run the suite with pytest.
93
100%
Does it follow best practices?
Impact
100%
1.00xAverage score across 2 eval scenarios
Passed
No known issues
Read a Postman Collection v2.1 JSON file, write a single pytest module that replays every request and asserts on the response. The collection stays the source of truth; the generated suite is committable code. Re-run the converter when the collection changes.
Full CLI reference, auth scrubbing details, stress testing, CI workflow templates, and limitations live in REFERENCE.md next to this file.
pip install postman2pytest"info" → "schema" contains v2.1.0.postman2pytest --collection my_api.postman_collection.json --out tests/test_api.pygrep -c '^def test_' tests/test_api.pyexport BASE_URL=https://api.example.com
export AUTHORIZATION="Bearer ..."pytest tests/test_api.py -vA collection with one folder Users (two requests) and a top-level Health check request produces three test functions:
def test_users_get_get_all_users():
def test_users_post_create_user():
def test_get_health_check():Filtering to a single folder shrinks the output to just the two Users tests:
postman2pytest --collection my_api.postman_collection.json \
--out /tmp/test_users.py --filter-folder UsersFolder matching is case-insensitive. The generated module is self-contained: imports os, pytest, and requests; nothing else, no conftest.py required.
BASE_URL not set: the generated module reads it from the environment, not the collection's stored host.--max-input-mb higher, or split via --filter-folder.Full error-handling tree + CLI flag reference + auth scrubbing details in REFERENCE.md.
For GitHub Actions / GitLab CI / Jenkins templates and a stress-test workflow on 500-2000 request collections, see REFERENCE.md sections "CI integration" and "Testing at scale".
REFERENCE.md (CLI flags, validation, stress testing, error tree, CI templates).tessl-plugin
evals
scenario-1
scenario-2