Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a prescision parameter to data_regression #177

Merged
merged 15 commits into from
Dec 17, 2024

Conversation

12rambau
Copy link
Contributor

Fix #170
Fix #159

This PR add a prescision parameter to the data_regression check. If unset the behaviour remain unchanged, if setn then any float value in the data_dict will be rounded to the specified number of digits. It will allow to handle more complex data shapes directly in the data_regression fixture and keep them in a humanly readable file format: yaml.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @12rambau for the PR, please see my comments.

src/pytest_regressions/common.py Outdated Show resolved Hide resolved
src/pytest_regressions/common.py Outdated Show resolved Hide resolved
src/pytest_regressions/common.py Outdated Show resolved Hide resolved
src/pytest_regressions/common.py Outdated Show resolved Hide resolved
src/pytest_regressions/data_regression.py Outdated Show resolved Hide resolved
tests/test_data_regression.py Outdated Show resolved Hide resolved
@nicoddemus nicoddemus requested a review from tadeu December 17, 2024 09:51
Copy link
Member

@tadeu tadeu left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@nicoddemus nicoddemus merged commit bf788f6 into ESSS:master Dec 17, 2024
11 checks passed
@nicoddemus
Copy link
Member

Thanks @12rambau! I will prepare a new release.

@12rambau 12rambau deleted the prescision branch December 17, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants