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

vlorentz created this revision.Jun 3 2019, 5:25 PM
anlambert added inline comments.
swh/web/tests/data.py
66–84

Can we turn these into pytest fixtures ?

I would prefer to keep test inputs as parameters.

vlorentz planned changes to this revision.Jun 5 2019, 11:48 AM
vlorentz requested review of this revision.Jun 5 2019, 2:14 PM
vlorentz added inline comments.
swh/web/tests/data.py
66–84

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

anlambert accepted this revision.Jun 17 2019, 11:09 AM
anlambert added inline comments.
swh/web/tests/data.py
66–84

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.