diff --git a/tests/unit/test_table.py b/tests/unit/test_table.py index 9579c0b..7fba922 100644 --- a/tests/unit/test_table.py +++ b/tests/unit/test_table.py @@ -1509,6 +1509,15 @@ def test_eq_with_non_table_returns_false( assert result is False + def test_eq_returns_not_implemented_for_non_table( + self, make_table: "Callable[..., Table]" + ) -> None: + table = make_table() + + result = table.__eq__("string") + + assert result is NotImplemented + def test_equal_relative_vs_absolute_path( self, tmp_path: "Path", monkeypatch: "pytest.MonkeyPatch" ) -> None: diff --git a/tests/unit/test_transaction.py b/tests/unit/test_transaction.py index 56af721..e02f187 100644 --- a/tests/unit/test_transaction.py +++ b/tests/unit/test_transaction.py @@ -1393,6 +1393,18 @@ def test_eq_with_non_transaction_returns_false( finally: tx.abort() + def test_eq_returns_not_implemented_for_non_transaction( + self, make_table: "Callable[..., Table]" + ) -> None: + table = make_table() + + tx = table.transaction() + try: + result = tx.__eq__("string") + assert result is NotImplemented + finally: + tx.abort() + def test_finalized_vs_active_not_equal(self, tmp_path: "Path") -> None: path1 = tmp_path / "test1.jsonlt" path2 = tmp_path / "test2.jsonlt"