Page MenuHomeSoftware Heritage

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

Authored by douardda on Oct 9 2019, 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

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.

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