Add support for selecting a Hypothesis profile to trial
Hypothesis has a notion of "profiles". These are named bags of global state which control certain behavior of Hypothesis process-wide. For example, a profile specifies whether all tests Hypothesis runs must complete in less than some fixed wallclock interval.
Hypothesis profiles may be used by third-party applications in their test suite which is run by trial or they may be used by Twisted itself (#11649). Either way, it's useful to be able to define a few of these and then choose between them on a run-by-run basis. For example, you might have a profile that's suitable for developers to use locally, another that's suitable for testing PRs on CI, and a third that's oriented towards expensive searches for previously unknown bugs which is triggered by a separate CI configuration or run in some other dedicated environment.
As far as I know, state of the art in runtime selection of Hypothesis profiles when using trial is to add some code to your test package's __init__.py that inspects an environment variable and chooses a profile a profile based on its value, then set that environment variable whenever you run trial.
This is a bit tricky to get right. First, you have to be aware of the approach at all. Next, you need to be careful not to allow multiple projects that follow this convention to trample on each other (for example, if two projects use the same environment variable name -- say, HYPOTHESIS_PROFILE -- then it becomes ambiguous which of them is being configured and the outcome may be surprising).
Instead of this, trial could accept a command line argument which causes trial itself to load a Hypothesis profile. Applications are still responsible for defining those profiles but it becomes trial's job to translate user intent (from the command line) into action (loading the profile).