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

Fix YamlItem in test_runner.py to clone TBS in case of reforms #1182

Merged
merged 2 commits into from
May 5, 2023

Conversation

Allan-CodeWorks
Copy link
Contributor

@Allan-CodeWorks Allan-CodeWorks commented May 3, 2023

Technical changes

  • Method _get_tax_benefit_system() of class YamlItem in file openfisca_core/tools/test_runner.py will now clone the TBS when applying reforms to avoid running tests with previously reformed TBS.

Notes

In the case we want to run 2 tests or more with differents reforms and no extensions we were sharing the same baseline so we were executing following tests with the TBS set in previous tests.

@coveralls
Copy link

coveralls commented May 3, 2023

Coverage Status

Coverage: 77.655% (-0.005%) from 77.659% when pulling e473b5d on fix_test_runner_reform_clone into fad5f69 on master.

@@ -22,7 +22,7 @@ def get_package_metadata(self):
return {"name": "Test", "version": "Test"}

def apply_reform(self, path):
return Reform(self)
Copy link
Member

Choose a reason for hiding this comment

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

😱

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-_-'

CHANGELOG.md Outdated
#### Technical changes

- Method `_get_tax_benefit_system()` of class `YamlItem` in file `openfisca_core/tools/test_runner.py` will now clone the TBS when applying reforms.
- Tests in `tests/core/tools/test_runner/test_yaml_runner.py` where not testing properly when applying reforms.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Tests in `tests/core/tools/test_runner/test_yaml_runner.py` where not testing properly when applying reforms.

@Allan-CodeWorks Allan-CodeWorks force-pushed the fix_test_runner_reform_clone branch 2 times, most recently from 0d50901 to ea205d1 Compare May 4, 2023 13:21
	- La methode de test apply_reform() renvoyer une nouvelle
instance de la réforme donc les tests étaient bisaisés.
@Allan-CodeWorks Allan-CodeWorks merged commit 5e4f2ad into master May 5, 2023
@Allan-CodeWorks Allan-CodeWorks deleted the fix_test_runner_reform_clone branch May 5, 2023 10:14
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.

None yet

3 participants