liveBook · Manning

Pytest

As explained in Enterprise RAG

pytest is a Python testing framework for discovering and running tests and reporting their results.

pytest runs automated evaluation tests for a RAG application, comparing generated answers with expected answers and asserting that each result passes. section 2.4.3

How Enterprise RAG covers it

How deep it goes
Demonstrates test-case construction, answer assertions, dependency installation, and CI execution without testing internals.
Examples
Uses fictional questions, generated answers, PASS/FAIL evaluation, test_automated_evals.py, and a GitHub Actions workflow.
What it assumes
Assumes Python, a RAG function, expected answers, environment variables, and a requirements.txt file.
What you can do after
Operate pytest to validate RAG answers locally and automatically in GitHub Actions.
How it connects
Connects automated evaluation with RAG systems, expected answers, GitHub Actions, dependency management, and API secrets.

Also explained in

Compare how 13 books explain pytest →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Enterprise RAG. The section links point to the parts of the book it draws on.