Skip to content

Commit

Permalink
Replace called_once_with test_objects.py for 3.12 support (#586)
Browse files Browse the repository at this point in the history
* Replace called_once_with test_objects.py for 3.12 support

* just replace with assert_called_once
  • Loading branch information
wbarnha authored Dec 8, 2023
1 parent 73be0a2 commit 53dfd18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/tables/test_objects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from unittest.mock import Mock, patch
from unittest.mock import MagicMock, Mock, patch

import pytest

Expand Down Expand Up @@ -54,7 +54,7 @@ class Test_ChangeloggedObjectManager:
def man(self, *, table):
man = ChangeloggedObjectManager(table)
man.ValueType = ValueType
man.storage.__setitem__ = Mock()
man.storage.__setitem__ = MagicMock()
return man

@pytest.fixture()
Expand All @@ -63,7 +63,7 @@ def storage(self, *, table):

def test_send_changelog_event(self, *, man, table, key, current_event):
man.send_changelog_event(key, 3, "value")
assert man.storage.__setitem__.called_once_with(key, "value")
man.storage.__setitem__.assert_called_once()
table._send_changelog.assert_called_once_with(
current_event(),
(3, key),
Expand Down

0 comments on commit 53dfd18

Please sign in to comment.