Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/conftest.py
Show All 17 Lines | |||||
from swh.model.model import BaseContent, Origin | from swh.model.model import BaseContent, Origin | ||||
from swh.model.tests.generate_testdata import gen_contents, gen_origins | from swh.model.tests.generate_testdata import gen_contents, gen_origins | ||||
from swh.storage.interface import StorageInterface | from swh.storage.interface import StorageInterface | ||||
# define tests profile. Full documentation is at: | # define tests profile. Full documentation is at: | ||||
# https://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles | # https://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles | ||||
settings.register_profile("fast", max_examples=5, deadline=5000) | settings.register_profile("fast", max_examples=5, deadline=5000) | ||||
settings.register_profile("slow", max_examples=20, deadline=5000) | settings.register_profile("slow", max_examples=20, deadline=5000) | ||||
# Load the fast profile by default to overcome default hypothesis values | |||||
# (max_examples=100, deadline=200) that are unsuitable for our tests. | |||||
# This can still be overloaded via the --hypothesis-profile option. | |||||
settings.load_profile("fast") | |||||
if pytest_cov is not None: | if pytest_cov is not None: | ||||
# pytest_cov + multiprocessing can cause a segmentation fault when starting | # pytest_cov + multiprocessing can cause a segmentation fault when starting | ||||
# the child process <https://forge.softwareheritage.org/P706>; so we're | # the child process <https://forge.softwareheritage.org/P706>; so we're | ||||
# removing pytest-coverage's hook that runs when a child process starts. | # removing pytest-coverage's hook that runs when a child process starts. | ||||
# This means code run in child processes won't be counted in the coverage | # This means code run in child processes won't be counted in the coverage | ||||
# report, but this is not an issue because the only code that runs only in | # report, but this is not an issue because the only code that runs only in | ||||
# child processes is the RPC server. | # child processes is the RPC server. | ||||
Show All 29 Lines |