Skip to content

Commit 387c1b1

Browse files
committed
test: relax typing in Decimal tests using cast to satisfy mypy
1 parent 8f19e8a commit 387c1b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_additional_coverage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import decimal
2-
from typing import Any
2+
from typing import Any, cast
33

44
import pytest
55

@@ -76,9 +76,9 @@ def test_list2xml_str_returns_subtree_when_list_headers_true(self) -> None:
7676
def test_get_xml_type_with_decimal_number(self) -> None:
7777
# Decimal is a numbers.Number but not int/float
7878
value = decimal.Decimal("5")
79-
assert dicttoxml.get_xml_type(value) == "number"
79+
assert dicttoxml.get_xml_type(cast(Any, value)) == "number"
8080
# And convert_kv should mark it as type="number"
81-
out = dicttoxml.convert_kv("key", value, attr_type=True)
81+
out = dicttoxml.convert_kv("key", cast(Any, value), attr_type=True)
8282
assert out == '<key type="number">5</key>'
8383

8484
def test_dicttoxml_cdata_with_cdata_end_sequence(self) -> None:

0 commit comments

Comments
 (0)