Skip to content

test: expand data.py coverage — load_data, corpus, eval, wrapped keys (33 new tests)#1

Open
hai-pilgrim wants to merge 1 commit into
mainfrom
test/data-load-coverage
Open

test: expand data.py coverage — load_data, corpus, eval, wrapped keys (33 new tests)#1
hai-pilgrim wants to merge 1 commit into
mainfrom
test/data-load-coverage

Conversation

@hai-pilgrim

Copy link
Copy Markdown
Owner

Summary

  • The existing test_data.py covered only 8 cases (create_dataset, collator, a few load_dataset formats)
  • load_data, load_corpus, build_system_prompt, and load_eval_data had zero test coverage
  • Several JSON unwrap keys and prompt/response key aliases were untested

Test plan

  • load_dataset — all 7 wrapper keys (data, samples, completions, training_samples, training_prompts, prompts, questions); input/user_message prompt keys; output/completion response keys
  • load_datatraining_prompts path, dataset file path, dataset-over-prompts priority, missing-source error
  • load_corpus — papers, text-string, text-dict, list, custom, and None when no corpus_file
  • build_system_prompt — direct, template+corpus, corpus-only, raises when no source configured
  • load_eval_data — simple, wrapped (all 4 keys), list answer, input key, lowercase normalisation
  • 41 total tests pass (33 new + 8 existing)

🤖 Generated with Claude Code

… (33 new tests)

The existing test_data.py covered only 8 cases around create_dataset,
collator, and a few load_dataset formats. Adds 33 new tests:

- load_dataset: all 7 wrapper keys (data, samples, completions,
  training_samples, training_prompts, prompts, questions), plus
  input/user_message prompt keys and output/completion response keys
- load_data: training_prompts path, dataset file path, dataset-over-
  prompts priority, missing-source error
- load_corpus: all 4 formats (papers, text-string, text-dict, list,
  custom), and None when no corpus_file
- build_system_prompt: direct, template+corpus, corpus-only, raises
  when no source configured
- load_eval_data: simple, wrapped (all 4 keys), list answer, input key,
  lowercase normalisation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants