Page MenuHomeSoftware Heritage

api/tests: split in 2 files and rewrite tests using pytest

Authored by douardda on Oct 9 2019, 5:40 PM.



using pytest-flask for

Depends on D2106

Diff Detail

rDCORE Foundations and core functionalities
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda created this revision.Oct 9 2019, 5:40 PM
vlorentz accepted this revision.Oct 9 2019, 5:53 PM
vlorentz added a subscriber: vlorentz.

I really don't like how app gets implicitly/indirectly used by the tests...

This revision is now accepted and ready to land.Oct 9 2019, 5:53 PM

Please add a comment on the app fixture to explain what is going on.

douardda updated this revision to Diff 7094.Oct 10 2019, 4:29 PM

rebased, get rid of pytest-flask and move some code in

pytest-flask has some side effects not easily fixed, so we just embed in our
pytest_plugin the required code, aka a flask_app_cliant fixture (same as
pytest-flask's client fixture), and a fixture hook to be executed each time
to ensure flake's test context is properly set.

This revision was landed with ongoing or failed builds.Oct 11 2019, 10:42 AM
This revision was automatically updated to reflect the committed changes.