- 
                Notifications
    
You must be signed in to change notification settings  - Fork 82
 
Open
Labels
kind:roadmapA group of issues, constituting a delivery roadmapA group of issues, constituting a delivery roadmapkind:testAdding missing tests or correcting existing testsAdding missing tests or correcting existing tests
Milestone
Description
Hi there!
I really enjoy OpenFisca, but I recently encountered an issue.
Here is what I did:
pytest openfisca_core openfisca_web_api --maxfail 0 --continue-on-collection-errors --quiet
Here is what I expected to happen:
XXX passed, X xfailed, XXX warnings in X.XXs
Here is what actually happened:
========================================================================================= short test summary info ==========================================================================================
FAILED openfisca_core/commons/formulas.py::openfisca_core.commons.formulas.apply_thresholds
FAILED openfisca_core/commons/formulas.py::openfisca_core.commons.formulas.switch
FAILED openfisca_core/holders/holder.py::openfisca_core.holders.holder.Holder.get_memory_usage
...
ERROR openfisca_core/scripts/measure_numpy_condition_notations.py::test_switch_select
Context:
Python provides doctests to help keep a testable documentation.
They provide some benefits:
- They help maintainers and contributors to spot bugs and improvement opportunities.
 - They helps reusers to understand the code quickly
 - They help separating contexts (unit, functional, ...)
 - They help produce the official doc
 
Complications:
Today the code coverage by doctests is mild, they are not run, and most of them are broken.
Some observed consequences:
- The code is in overall hard to grasp without a consequent time investment, thus hard to contribute to
 - The code is hard to test unitarily due to its current design
 - There are then very few unit tests
 - The documentation 
iswas broken 
Proposal:
Fix, complete, and run doctests systematically!
TODO
- Fix commons doctests #1250
 - Fix data_storage doctests #1249
 - Fix entities doctests #1254
 - Fix holders doctests #1266
 - Fix enums doctests #1267
 - Fix parameters doctests #1268
 - Fix periods doctests #1269
 - Fix populations doctests #1276
 -  9.  Improve 
openfisca_core.projectorsdoctests -  10. Improve 
openfisca_core.reformsdoctests -  11. Improve 
openfisca_core.simulation_builderdoctests -  12. Improve 
openfisca_core.simulationsdoctests -  13. Improve 
openfisca_core.taxbenefitsystemsdoctests -  14. Improve 
openfisca_core.taxscalesdoctests -  15. Improve 
openfisca_core.tracersdoctests -  16. Improve 
openfisca_core.variablesdoctests -  17. Improve 
openfisca_web_api.loaderdoctests 
Metadata
Metadata
Assignees
Labels
kind:roadmapA group of issues, constituting a delivery roadmapA group of issues, constituting a delivery roadmapkind:testAdding missing tests or correcting existing testsAdding missing tests or correcting existing tests
Type
Projects
Status
Roadmaps/Themes