Page MenuHomeSoftware Heritage

Stop using hypothesis for tests that don't need it.
ClosedPublic

Authored by vlorentz on Jun 3 2019, 5:25 PM.

Details

Summary

These hypothesis are only used to generate random hashes (and checking
they are not already used).
A single random hash is sufficient and faster.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert added inline comments.
swh/web/tests/data.py
65–83

Can we turn these into pytest fixtures ?

I would prefer to keep test inputs as parameters.

vlorentz added inline comments.
swh/web/tests/data.py
65–83

No, because I need to use more than one random_sha1 in a test, and pytest fixtures don't work for TestCase methods.

anlambert added inline comments.
swh/web/tests/data.py
65–83

Oh right, I forgot that. Let's land this then.

This revision is now accepted and ready to land.Jun 17 2019, 11:09 AM
This revision was landed with ongoing or failed builds.Jun 17 2019, 11:50 AM
This revision was automatically updated to reflect the committed changes.