Skip to content

Use pytest-datadir in CI tests#4836

Merged
albertvillanova merged 3 commits intohuggingface:mainfrom
albertvillanova:use-pytest-datadir
Jan 16, 2026
Merged

Use pytest-datadir in CI tests#4836
albertvillanova merged 3 commits intohuggingface:mainfrom
albertvillanova:use-pytest-datadir

Conversation

@albertvillanova
Copy link
Copy Markdown
Member

Use pytest-datadir in CI tests.

This PR improves the test infrastructure by adding the pytest-datadir dependency and updates two test cases to use the shared_datadir fixture for accessing test data. This change makes the tests more robust and portable by ensuring test data paths are handled consistently.

Test infrastructure improvements:

  • Added pytest-datadir to both the test and dev dependency groups in pyproject.toml to provide a fixture for managing test data directories.

Test case updates:

  • Updated test_train_with_set_chat_template_from_path in both tests/test_reward_trainer.py and tests/test_sft_trainer.py to use the shared_datadir fixture instead of a hardcoded path for loading template.jinja.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova albertvillanova merged commit fd296b5 into huggingface:main Jan 16, 2026
10 checks passed
marcandrelarochelle pushed a commit to marcandrelarochelle/trl that referenced this pull request Mar 25, 2026
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.

3 participants