Skip to content

Commit 02b04c7

Browse files
committed
Fix test
1 parent 5286627 commit 02b04c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import pytest
55

6+
from geolib._compat import IS_PYDANTIC_V2
67
from geolib.models import BaseDataClass
78
from geolib.models.utils import get_filtered_type_hints, get_required_class_field
89

@@ -32,7 +33,10 @@ def test_given_class_when_get_required_class_field_then_only_valid_fields_return
3233
assert len(filtered_types) == 1
3334
field_name, field_type = filtered_types[0]
3435
assert field_name == "regular_field"
35-
assert field_type == int
36+
if IS_PYDANTIC_V2:
37+
assert field_type.annotation == int
38+
else:
39+
assert field_type.type_ == int
3640

3741
@pytest.mark.unittest
3842
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)