Skip to content

Conversation

bonjourmauko
Copy link
Member

@bonjourmauko bonjourmauko commented Apr 11, 2021

Related to #969 (it is almost a subset of it, it only extracts CountryTaxBenefitSystem to a fixture).
Related to #984 (it adds more modularity but does not evince country template's scenarios).

Technical changes

  • In tests, extract CountryTaxBenefitSystem to a fixture reusable by all the tests in the test suite.
    • It allows for a better reusability of test scenarios available to new contributors.
    • To mitigate possible performance issues, by default the fixture is initialised once per test module.
Performance

Impact on performance of the test suite is neglectable.

Before:

openfisca-core[master] > time for i in {1..10}; do pytest; done


real	1m59.024s
user	1m42.614s
sys	0m27.081s

After:

openfisca-core[extract-tbs-fixture] >  time for i in {1..10}; do pytest; done

real	2m5.148s
user	1m46.425s
sys	0m28.280s

@bonjourmauko bonjourmauko added the kind:refactor Refactoring and code cleanup label Apr 11, 2021
Copy link
Contributor

@RamParameswaran RamParameswaran left a comment

Choose a reason for hiding this comment

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

Thanks @maukoquiroga. This is a good forward step towards modularity!

I just have one general question regarding the 'simulation_builder' fixture (see inline comments).

Otherwise, generally looks good - happy to approve 😄

@bonjourmauko
Copy link
Member Author

I just have one general question regarding the 'simulation_builder' fixture (see inline comments).

You're right! I've accepted your suggestion.

Copy link
Contributor

@RamParameswaran RamParameswaran left a comment

Choose a reason for hiding this comment

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

LGTM.
I have no additional concerns since my last review. Thanks for incorporating my comment about the simulation_builder fixture.
And the styleguide is fantastic 💥

Nice one @maukoquiroga! 👏

@bonjourmauko bonjourmauko merged commit 7566d96 into master Apr 14, 2021
@bonjourmauko bonjourmauko deleted the extract-tbs-fixture branch April 14, 2021 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:refactor Refactoring and code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants