PyTest Architecture, AI Markers & JUnit
Python, PyTest & SQL Foundations for AI QE β Day 1
Design a production PyTest evaluation harness with shared conftest.py fixtures, strict custom markers (@pytest.mark.probabilistic, @pytest.mark.safety, @pytest.mark.sql), a structured EvalCollector, and JUnit XML exports.
Ad-hoc Python scripts fail to scale when regulated financial and consumer AI assistants need fast PR feedback and auditable CI evidence. Today you will structure a reusable PyTest suite with--strict-markers, shared conftest.py fixtures, a structuredEvalCollector, and machine-readable JUnit XML reporting.
The official reference codebase for Day 1 is hosted in the repository. Clone the repository and navigate to day-1-pytest-architecture/test_day1_architecture.py to run the working solution.
git clone https://github.com/777abhi/pytest-sql-ai-qe-roadmap.git
cd pytest-sql-ai-qe-roadmap/day-1-pytest-architecture/test_day1_architecture.pyRun & Inspect PyTest Architecture & Custom Markers
Clone the offline companion repository, install PyTest, and run the Day 1 test suite.
git clone https://github.com/777abhi/pytest-sql-ai-qe-roadmap.git
cd pytest-sql-ai-qe-roadmap
pip install -r requirements.txt
npm run test:day1python3 -m pytest -m safety day-1-pytest-architecture
python3 -m pytest day-1-pytest-architecture --junitxml=artifacts/junit-day1.xml- Configured pytest.ini with --strict-markers to prevent silent marker typos in CI pipelines.
- Built reusable conftest.py fixtures for structured evaluation collection and isolated test state.
- Exported per-case AI evaluation scores and failure reasons to JSON and CI-ready JUnit XML.
π§ Knowledge Check
Why should AI QE teams enable --strict-markers in pytest.ini and separate tests with markers like @pytest.mark.safety and @pytest.mark.probabilistic?