HomeSoftware Heritage

tests: Satisfy hypothesis warnings about ordered samples

Description

tests: Satisfy hypothesis warnings about ordered samples

Prior to this commit, we had the following warnings:

HypothesisDeprecationWarning: Cannot sample from {b'iso8859-15',
b'iso8859-1', b'latin1', b'utf-8'}, not an ordered
collection. Hypothesis goes to some length to ensure that the
sampled_from strategy has stable results between runs. To replay a
saved example, the sampled values must have the same iteration order
on every run - ruling out sets, dicts, etc due to hash
randomisation. Most cases can simply use sorted(values), but mixed
types or special values such as math.nan require careful handling -
and note that when simplifying an example, Hypothesis treats earlier
values as simpler.

Changed the data sample from sets to ordered list.

Details

Provenance
ardumontAuthored on Nov 14 2018, 12:24 PM
ardumontPushed on Nov 14 2018, 3:50 PM
Differential Revision
D654: swh.indexer.storage: Open content_mimetype_get_range
Parents
rDCIDXdcde287fbd90: tests: Use complete hypothesis generation dsl
Branches
Unknown
Tags
Unknown