From 441eb31b498f82d3f978b374b6e4c23b62edfbe0 Mon Sep 17 00:00:00 2001 From: stephanbreimann Date: Mon, 8 Apr 2024 19:48:30 +0200 Subject: [PATCH] Update aaclust test --- README.rst | 8 ++++---- tests/unit/aaclust_tests/test_aaclust_name_clusters.py | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index ffb1938c..98f661b8 100644 --- a/README.rst +++ b/README.rst @@ -24,15 +24,15 @@ Welcome to the AAanalysis documentation! :target: https://github.com/breimanntools/aaanalysis/blob/master/LICENSE :alt: License -.. |CI/CD pipeline| image:: https://github.com/breimanntools/aaanalysis/workflows/main/badge.svg - :target: https://github.com/breimanntools/aaanalysis/actions +.. |CI/CD pipeline| image:: https://github.com/breimanntools/aaanalysis/actions/workflows/main.yml/badge.svg + :target: https://github.com/breimanntools/aaanalysis/actions/workflows/main.yml :alt: CI/CD Pipeline -.. |Test Coverage| image:: https://github.com/breimanntools/aaanalysis/workflows/test_coverage/badge.svg +.. |Test Coverage| image:: https://github.com/breimanntools/aaanalysis/actions/workflows/test_coverage/badge.svg :target: https://github.com/breimanntools/aaanalysis/actions :alt: Test Coverage -.. |Code QL| image:: https://github.com/breimanntools/aaanalysis/workflows/codeql_analysis/badge.svg +.. |Code QL| image:: https://github.com/breimanntools/aaanalysis/actions/workflows/codeql_analysis/badge.svg :target: https://github.com/breimanntools/aaanalysis/actions :alt: CodeQL diff --git a/tests/unit/aaclust_tests/test_aaclust_name_clusters.py b/tests/unit/aaclust_tests/test_aaclust_name_clusters.py index af2eaf32..fb6e5ece 100644 --- a/tests/unit/aaclust_tests/test_aaclust_name_clusters.py +++ b/tests/unit/aaclust_tests/test_aaclust_name_clusters.py @@ -112,10 +112,11 @@ def test_combination_valid_parameters(self, X, labels): warnings.simplefilter("ignore", RuntimeWarning) aa.AAclust().name_clusters(X, labels, names) else: - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RuntimeWarning) - result = aa.AAclust().name_clusters(X, labels, names) - assert isinstance(result, list) + if n_unique_labels > 1: + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RuntimeWarning) + result = aa.AAclust().name_clusters(X, labels, names) + assert isinstance(result, list) @given(X=npst.arrays(dtype=np.float64, shape=npst.array_shapes(min_dims=2, max_dims=2, max_side=50), elements=some.floats(allow_nan=True, allow_infinity=True)))