Skip to content

Consolidate test fixtures into shared conftest.py #5

Description

@riccardomerenda

Problem

Test files independently recreate sample configs, corpus records, model responses, and evaluation results. This leads to duplication and inconsistency — a schema change requires updates in multiple test files.

Proposal

Create/extend tests/conftest.py with shared fixtures:

  • sample_config — a minimal valid DriftcutConfig
  • sample_corpus — a list of 5-10 PromptRecord covering all criticality/output type combinations
  • sample_model_response — a ModelResponse factory
  • sample_evaluation — a PromptEvaluation factory

Keep test-specific data local, move repeated structures to fixtures.

Impact

  • Less duplication across 14 test files
  • Easier to update when models/config schema changes
  • Lower barrier for writing new tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions