Skip to content

Commit 10f23d4

Browse files
authored
Create test_typing.py
Testing the typing module in ibis.common
1 parent 5a3ea1c commit 10f23d4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

ibis/tests/test_typing.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pytest
2+
from typing import Any
3+
4+
from ibis.common.typing import get_type_hints
5+
6+
class TestClass:
7+
a: int
8+
@property
9+
def b(self) -> str:
10+
return "test"
11+
@property
12+
def c(self) -> Any:
13+
raise AttributeError("Property 'c' raises AttributeError")
14+
15+
def test_get_type_hints_with_attribute_error():
16+
hints = get_type_hints(TestClass, include_properties=True)
17+
assert hints == {"a": int, "b": str}

0 commit comments

Comments
 (0)