Skip to content

Consolidate test fixtures for consistency#3

Merged
juehang merged 1 commit into
mainfrom
test/consolidate-fixtures
Nov 20, 2025
Merged

Consolidate test fixtures for consistency#3
juehang merged 1 commit into
mainfrom
test/consolidate-fixtures

Conversation

@juehang
Copy link
Copy Markdown
Collaborator

@juehang juehang commented Nov 20, 2025

Summary

Centralizes test configuration in conftest.py and improves fixture reuse across test modules.

Changes

  • Add grad_precision_tolerance fixture (1e-3) to conftest.py
  • Update sample_data fixture to use shared rng_key and sample_size from conftest
  • Increase sample size from 5 to 1000 for consistency with bijection tests
  • Use grad_precision_tolerance parameter in gradient precision tests

Result

All test configurations now centralized in conftest.py
Consistent sample sizes (1000) across test suites
Configurable tolerances in one location

- Add grad_precision_tolerance fixture to conftest.py (1e-3)
- Update sample_data to use shared rng_key and sample_size fixtures
- Change sample size from 5 to 1000 for consistency with bijection tests
- Use grad_precision_tolerance parameter in test_round_trip_grad_precision

All test configurations now centralized in conftest.py.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR consolidates test configuration by moving shared fixtures and constants to conftest.py, improving test consistency and maintainability across the test suite.

  • Adds grad_precision_tolerance fixture to centralize gradient test tolerances
  • Updates sample_data fixture to use shared rng_key and sample_size from conftest.py
  • Standardizes sample size to 1000 across gradient and bijection tests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/conftest.py Adds grad_precision_tolerance fixture (1e-3) for gradient precision tests
tests/test_dataloader_jax_grad.py Refactors sample_data fixture to use centralized rng_key and sample_size fixtures; updates gradient precision test to use grad_precision_tolerance parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_dataloader_jax_grad.py
Comment thread tests/conftest.py
@juehang juehang merged commit b2550a8 into main Nov 20, 2025
7 checks passed
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