From 7b2b36a6a53a9644f8680e0a268ecbee193f6d60 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Tue, 12 Sep 2023 14:05:38 +0100 Subject: [PATCH] Fix for python 3.7 --- tests/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index cfa1340de..a24b7f6c5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,10 +2,13 @@ # SPDX-License-Identifier: BSD-3-Clause import hypothesis +from packaging import version import torch SEED = 123456 DIFFERING_EXECUTOR_ENUM = 10 # Disabled since it fails with normal test setup +HYPOTHESIS_HEALTHCHECK_VERSION = '6.83.2' # The new healthcheck was introduced in this version torch.random.manual_seed(SEED) -hypothesis.settings(suppress_health_check=[hypothesis.HealthCheck(DIFFERING_EXECUTOR_ENUM)]) +if version.parse(hypothesis.__version__) >= version.parse(HYPOTHESIS_HEALTHCHECK_VERSION): + hypothesis.settings(suppress_health_check=[hypothesis.HealthCheck(DIFFERING_EXECUTOR_ENUM)])