Skip to content

Commit 2b58edc

Browse files
author
khushthecoder
committed
fix: handle typeguard TypeCheckError in test_non_string_input
The CI uses typeguard which enforces type annotations at runtime, raising TypeCheckError instead of TypeError when a non-str argument is passed to validate_query(). Add TypeCheckError to the expected exceptions tuple.
1 parent 6fafe9b commit 2b58edc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/anoph/test_safe_query.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import pytest
9+
from typeguard import TypeCheckError
910

1011
from malariagen_data.anoph.safe_query import UnsafeQueryError, validate_query
1112

@@ -181,7 +182,7 @@ def test_whitespace_only(self):
181182
validate_query(" ")
182183

183184
def test_non_string_input(self):
184-
with pytest.raises((UnsafeQueryError, TypeError)):
185+
with pytest.raises((UnsafeQueryError, TypeError, TypeCheckError)):
185186
validate_query(123)
186187

187188
def test_syntax_error(self):

0 commit comments

Comments
 (0)