CtrlK
BlogDocsLog inGet started
Tessl Logo

golikovichev/postman2pytest

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

1.00x
Quality

100%

Does it follow best practices?

Impact

100%

1.00x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

CONTRIBUTING.md

Contributing to postman2pytest

Thank you for your interest in contributing!

Setup

git clone https://github.com/golikovichev/postman2pytest
cd postman2pytest
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pip install pytest

Running tests

pytest tests/ -v --tb=short

All tests must pass before opening a PR.

Project structure

core/
  parser.py     - Postman JSON → ParsedRequest objects
  generator.py  - ParsedRequest list → pytest file via Jinja2
templates/
  test_collection.jinja2  - output template
tests/
  test_parser.py    - unit tests for parser
  test_generator.py - unit tests for generator
main.py           - CLI entry point
data/             - sample collections for manual testing

Submitting changes

  1. Fork the repo and create a branch: git checkout -b feat/my-change
  2. Write tests for new behaviour
  3. Ensure pytest tests/ -v passes
  4. Open a pull request with a clear description of the change and motivation

Code style

  • Python 3.10+ type hints throughout
  • No external dependencies beyond pydantic, jinja2, requests
  • Keep core/parser.py free of business logic unrelated to parsing
  • Keep core/generator.py thin - logic belongs in the template or the model

CHANGELOG.md

CONTRIBUTING.md

main.py

README.md

REFERENCE.md

SECURITY.md

SKILL.md

tessl.json

tile.json