14
0

Accepting request 1137389 from home:bnavigator:branches:devel:languages:python

- Add qstylizer-pr17-fix-py12-mock.patch gh#blambright/qstylizer#17
- Move to PEP517 build

OBS-URL: https://build.opensuse.org/request/show/1137389
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-qstylizer?expand=0&rev=12
This commit is contained in:
2024-01-07 19:13:35 +00:00
committed by Git OBS Bridge
parent 358277617a
commit 82456756cd
3 changed files with 44 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Jan 7 17:31:10 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Add qstylizer-pr17-fix-py12-mock.patch gh#blambright/qstylizer#17
- Move to PEP517 build
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 7 03:46:52 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com> Fri Oct 7 03:46:52 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-qstylizer # spec file for package python-qstylizer
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-qstylizer Name: python-qstylizer
Version: 0.2.2 Version: 0.2.2
Release: 0 Release: 0
@@ -25,8 +24,12 @@ License: MIT
URL: https://github.com/blambright/qstylizer URL: https://github.com/blambright/qstylizer
# no sdist on PyPI # no sdist on PyPI
Source: https://github.com/blambright/qstylizer/archive/refs/tags/%{version}.tar.gz#/qstylizer-%{version}-gh.tar.gz Source: https://github.com/blambright/qstylizer/archive/refs/tags/%{version}.tar.gz#/qstylizer-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM qstylizer-pr17-fix-py12-mock.patch gh#blambright/qstylizer#17
Patch0: https://github.com/blambright/qstylizer/pull/17.patch#/qstylizer-pr17-fix-py12-mock.patch
BuildRequires: %{python_module pbr} BuildRequires: %{python_module pbr}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module inflection > 0.3.0} BuildRequires: %{python_module inflection > 0.3.0}
@@ -51,11 +54,11 @@ A python package designed to help with the construction of PyQt/PySide styleshee
%build %build
export PBR_VERSION=%{version} export PBR_VERSION=%{version}
%python_build %pyproject_wheel
%install %install
export PBR_VERSION=%{version} export PBR_VERSION=%{version}
%python_install %pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
@@ -65,6 +68,6 @@ export PBR_VERSION=%{version}
%doc README.rst %doc README.rst
%license LICENSE.txt %license LICENSE.txt
%{python_sitelib}/qstylizer %{python_sitelib}/qstylizer
%{python_sitelib}/qstylizer-%{version}*-info %{python_sitelib}/qstylizer-%{version}.dist-info
%changelog %changelog

View File

@@ -0,0 +1,30 @@
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(