From f7e72ae28fa340355e082a21025d099ae6d05bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Sch=C3=B6nfeldt?= Date: Mon, 26 Aug 2024 21:29:29 +0200 Subject: [PATCH] Test for long sequence warning --- tests/test_plumbing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_plumbing.py b/tests/test_plumbing.py index d5fb7da38..618f2df7d 100644 --- a/tests/test_plumbing.py +++ b/tests/test_plumbing.py @@ -70,6 +70,9 @@ def test_valid_sequence(): np_array = np.array([0, 1, 2, 3, 4]) assert valid_sequence(np_array, 5) + with pytest.warns(FutureWarning, match="Sequence longer than needed"): + valid_sequence(np_array, 4) + # it's not that long with pytest.raises(ValueError): valid_sequence(np_array, 1337)