Test chat bots, voice assistants, and IVR menus with pytest using a small Conversation object and a callable bot adapter. Use when the user wants to write rule-based assertions over multi-turn dialogue without bringing in an LLM dependency, when they have a chatbot reachable as a Python callable or HTTP webhook, when they need to keep per-conversation state across turns and assert on slot filling, when they want pytest-native fixtures and a printable transcript on failure, or when they mention voice-assistant testing, IVR menu testing, conversational AI testing, LLM bot testing (used as the target under test, not as the matcher), expect matchers for bot replies, or multi-turn dialogue tests.
99
100%
Does it follow best practices?
Impact
97%
1.56xAverage score across 3 eval scenarios
Passed
No known issues
Acme Devices recently launched a new customer support bot for their online store. The bot handles a range of common interactions: greeting customers, answering questions about products and their support phone number, and returning a polite error message when something goes wrong internally. Because the bot is powered by a third-party NLP service, its exact phrasing can vary slightly from run to run — for example, it might acknowledge a question with "Sure!", "Of course!", or "Happy to help!" before giving the actual answer. Your team wants a solid automated test suite to catch regressions as the bot evolves.
The bot is a pure Python function — no external service or network call required. You'll implement a small stub that covers the four interaction types, then write pytest tests using the pytest-conversational library to verify it behaves correctly. The test suite should cover: that replies contain expected keywords, that error replies don't expose internal details, that formatted contact information (phone number) is present and well-formed, and that flexible acknowledgement phrases are all accepted as valid responses.
Produce the following files in your working directory:
test_support_bot.py — a pytest test file containing the bot stub and the full test suite. The file must be runnable with pytest test_support_bot.py -v.results.txt — the captured output of running pytest test_support_bot.py -v, saved to this file.All tests should pass. The bot stub and tests should be self-contained in test_support_bot.py with no external dependencies beyond pytest-conversational (install it with pip if needed before running).
.tessl-plugin
evals
src
pytest_conversational
tests