HomeSoftware Heritage

tests: Ensure they all can be run with multiple hypothesis examples

Description

tests: Ensure they all can be run with multiple hypothesis examples

When running swh-web tests using 'make test-full', multiple hypothesis examples
are provided as test inputs instead of a single one when running 'make test'.
In that case some tests were failing mostly due to the fact they were not stateless
between test runs.

That commit fixes those tests execution and ensures stateless test runs by:

  • turning some hypothesis strategies into stateless ones
  • turning the archive_data fixture into a function scope one
  • using subtest fixture from pytest-subtesthack when it is required to reset the archive_data fixture for a test between hypothesis example runs

As a consequence, tests will be longer to execute as global state will be reseted
between each test.

Nevertheless, metadata related tests are still failing when running with multiple
hypothesis examples, fix will be handled in next commit.

Related to T1695