This repository has no description
1# Adapted From: https://github.com/pytest-dev/pytest/issues/2269#issue-209278464
2import os.path as op
3import sys
4
5sys.path.remove(op.dirname(op.abspath(__file__)))
6
7from pytest import hookimpl
8from hypothesis import HealthCheck
9from hypothesis import settings
10from functools import partial
11
12# Adapted From: https://docs.pytest.org/en/stable/example/simple.html
13# And: https://github.com/pytest-dev/pytest/issues/5024#issuecomment-2078698395
14# And: https://pytest-with-eric.com/hooks/pytest-configure/
15name = "oreo"
16kwargs = {
17 "deadline": None,
18 "derandomize": True,
19 "suppress_health_check": (
20 HealthCheck.differing_executors,
21 HealthCheck.filter_too_much,
22 HealthCheck.function_scoped_fixture,
23 HealthCheck.too_slow,
24 ),
25}
26
27
28def pytest_addoption(parser):
29 parser.addoption("--more-tests", action="store", default=False, type=bool)
30 parser.addoption("--verbose-debug", action="store", default=False, type=bool)
31
32
33@hookimpl(tryfirst=True)
34def pytest_configure(config):
35 if config.getoption("--more-tests"):
36 kwargs["max_examples"] = 1000
37 if config.getoption("--verbose-debug"):
38 kwargs["verbosity"] = Verbosity.debug
39 settings.register_profile(name, **kwargs)
40 settings.load_profile("oreo")