From e4750ea82406c0151b542ca644506f66cc4c8ad4 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Tue, 12 Sep 2023 11:16:16 +0100 Subject: [PATCH 1/3] Fix (test): ignore hypothesis health check --- tests/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index e82a6c080..5f247188f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,11 @@ # Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause +import hypothesis import torch SEED = 123456 +DIFFERING_EXECUTOR_ENUM = 10 # Disabled since it fails with normal test setup + torch.random.manual_seed(SEED) +hypothesis.settings(suppress_health_check=hypothesis.HealthCheck(DIFFERING_EXECUTOR_ENUM)) From 713a77861d223b7833828c061ed78b02f2421c24 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Tue, 12 Sep 2023 13:07:14 +0100 Subject: [PATCH 2/3] Change to list --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5f247188f..cfa1340de 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,4 +8,4 @@ DIFFERING_EXECUTOR_ENUM = 10 # Disabled since it fails with normal test setup torch.random.manual_seed(SEED) -hypothesis.settings(suppress_health_check=hypothesis.HealthCheck(DIFFERING_EXECUTOR_ENUM)) +hypothesis.settings(suppress_health_check=[hypothesis.HealthCheck(DIFFERING_EXECUTOR_ENUM)]) From 7b2b36a6a53a9644f8680e0a268ecbee193f6d60 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Tue, 12 Sep 2023 14:05:38 +0100 Subject: [PATCH 3/3] 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)])