Page MenuHomeSoftware Heritage

api/tests: split test_api.py in 2 files and rewrite tests using pytest
ClosedPublic

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

Details

Summary

using pytest-flask for test_rpc_server.py

Depends on D2106

Diff Detail

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

Event Timeline

douardda created this revision.Wed, Oct 9, 5:40 PM
vlorentz accepted this revision.Wed, Oct 9, 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.Wed, Oct 9, 5:53 PM

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

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

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

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.Fri, Oct 11, 10:42 AM
This revision was automatically updated to reflect the committed changes.