File qstylizer-pr17-fix-py12-mock.patch of Package python-qstylizer
From dac82fc9204dd0a2e34ca5d2da508b7874da7d91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sun, 5 Nov 2023 17:18:49 +0100
Subject: [PATCH] Fix typo in tests: use assert_called_once_with()
Fix a typo in tests whereas `.called_once_with()` is called rather than
`.assert_called_once_with()`. This gets mocked in Python < 3.12
and therefore it is ignored (but doesn't test correctly) but it triggers
an error in Python 3.12:
```
E AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'?
```
---
test/unit/test_style.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/unit/test_style.py b/test/unit/test_style.py
index a911822..36b5296 100644
--- a/test/unit/test_style.py
+++ b/test/unit/test_style.py
@@ -184,7 +184,7 @@ def test_create_child_rule_list(mocker, style_class, css):
)
mocked_set_child_rule = mocker.patch.object(style_class, "set_child_rule")
assert css.create_child_rule_list(name) == style_list
- mocked_set_child_rule.called_once_with(name, style_list)
+ mocked_set_child_rule.assert_called_once_with(name, style_list)
@pytest.mark.parametrize(