Python Automation Frameworks: Behave and Pytest with AI Agents
How I build Python API automation frameworks with Behave, pytest and Requests: structure, fixtures,...
Read moreBlog Category
Python, Behave, BDD, and pytest — building automation suites that hold up.
How I build Python API automation frameworks with Behave, pytest and Requests: structure, fixtures,...
Read moreWhen one API call feeds the next, isolated tests miss the break. How I test request chains in pytest and Behave, and check AI agents chain tool calls.
Read moreEvery endpoint returns 200 and the workflow still breaks. How I test call sequences in pytest and Behave, and check AI agents call tools in order.
Read moreA 200 with a missing field still breaks consumers. How I assert field presence in pytest and Behave, and keep agent refactors from dropping fields.
Read moreA 200 with "42" instead of 42 still breaks things. How I catch type mismatches with pytest, jsonschema, pydantic and Behave, including in agent tool calls.
Read moreMock only what you must. Scoping pytest mocks of external APIs tightly, keeping them honest, and stopping coding agents from mocking a failure away.
Read moreGherkin rots under deadlines, and faster when agents write it. How I keep Behave scenarios readable: titles, one abstraction level, lean Backgrounds.
Read moreconftest.py grows by accretion, faster when agents add fixtures. How I layer, scope and split pytest fixtures so people and coding agents find them.
Read moreA 200 OK doesn't mean the API worked. How I catch silent failures in Python tests, and why they hurt more when an AI agent calls the API as a tool.
Read moreKeep pytest.mark.parametrize readable for API edge cases with ids, pytest.param and data tables, and review agent-generated case lists before they bloat.
Read moreBehave step definitions rot when each is written for one scenario, faster when agents add them. Patterns that keep steps reusable, findable and clean.
Read morepytest-xdist makes API suites faster, and agent-written tests make hidden shared state worse. How I parallelize without trading speed for flaky runs.
Read moreHow Behave's context layers work, how to share data without scenario bleed, and the rules I give AI agents so generated steps don't leak state.
Read moreBDD and pytest both work for API tests. Once Copilot and coding agents write much of the code, the choice comes down to who owns the spec. How I decide.
Read moreScope, factory fixtures and teardown for real API suites, plus how fixtures keep agent-written tests consistent and make model-calling code testable.
Read moreThe folder layout, step organisation and tag scheme that keep a Behave suite maintainable past 50 scenarios, and readable for the AI agents working in it.
Read moreTest automation should be fun, practical, and future-ready — that's the mission of TestJeff.