Skip to content

Commit ffde0d7

Browse files
committed
Change check
1 parent f633484 commit ffde0d7

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/a2a/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __setattr__(self, name: str, value: Any) -> None:
6464
# Get the map and find the corresponding snake_case field name.
6565
field_name = type(self)._get_alias_map().get(name) # noqa: SLF001
6666

67-
if field_name:
67+
if field_name and field_name != name:
6868
# An alias was used, issue a warning.
6969
warnings.warn(
7070
(
@@ -83,7 +83,7 @@ def __getattr__(self, name: str) -> Any:
8383
# Get the map and find the corresponding snake_case field name.
8484
field_name = type(self)._get_alias_map().get(name) # noqa: SLF001
8585

86-
if field_name:
86+
if field_name and field_name != name:
8787
# An alias was used, issue a warning.
8888
warnings.warn(
8989
(

tests/test_types.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,13 +1551,6 @@ def test_camelCase(recwarn) -> None:
15511551
supportsAuthenticatedExtendedCard=True,
15521552
)
15531553

1554-
# Test accessing a standard property like 'version' should not produce a deprecation warning
1555-
version = agent_card.version
1556-
assert version == '1.0.0'
1557-
assert (
1558-
not recwarn.list # Assert that no warnings were emitted during the access
1559-
)
1560-
15611554
# Test setting an attribute via camelCase alias
15621555
with pytest.warns(
15631556
DeprecationWarning,

0 commit comments

Comments
 (0)