Skip to content

Commit

Permalink
Minor improvements of objects_are_equal (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
durandtibo authored Mar 30, 2024
1 parent c0deaa2 commit 2e75509
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/coola/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
if TYPE_CHECKING:
from coola.equality.testers import BaseEqualityTester

_tester = EqualityTester()


def objects_are_allclose(
actual: Any,
Expand Down Expand Up @@ -67,7 +69,7 @@ def objects_are_allclose(
```
"""
tester = tester or EqualityTester()
tester = tester or _tester
config = EqualityConfig(
tester=tester, show_difference=show_difference, equal_nan=equal_nan, atol=atol, rtol=rtol
)
Expand Down Expand Up @@ -114,6 +116,6 @@ def objects_are_equal(
```
"""
tester = tester or EqualityTester()
tester = tester or _tester
config = EqualityConfig(tester=tester, show_difference=show_difference, equal_nan=equal_nan)
return tester.equal(actual, expected, config)

0 comments on commit 2e75509

Please sign in to comment.