Skip to content

Commit e69e3c1

Browse files
committed
Add test method to property_utils
1 parent 5dc8393 commit e69e3c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/property_utils/tests/properties/property_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ def assert_result(self, result_str):
4545
self.assertResultIsNot(self.prop())
4646
self.assertSequenceEqual(str(self.cachedResult()), result_str, str)
4747

48+
def assert_result_almost(self, result_str):
49+
self.assertResultIsNot(self.prop())
50+
result = self.cachedResult()
51+
result.value = round(result.value, 2)
52+
self.assertSequenceEqual(str(result), result_str, str)
53+
4854
def _assert_error(self, error: PropertyUtilsException, expected_regex):
4955
if expected_regex is None:
5056
self.assertResultRaises(error)

0 commit comments

Comments
 (0)