Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pytest-profiling for openSUSE:Factory checked in at 2024-03-13 22:18:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest-profiling (Old) and /work/SRC/openSUSE:Factory/.python-pytest-profiling.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-profiling" Wed Mar 13 22:18:04 2024 rev:5 rq:1157078 version:1.7.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest-profiling/python-pytest-profiling.changes 2022-12-09 13:19:51.983666336 +0100 +++ /work/SRC/openSUSE:Factory/.python-pytest-profiling.new.1770/python-pytest-profiling.changes 2024-03-13 22:18:59.541186415 +0100 @@ -1,0 +2,11 @@ +Tue Mar 12 04:30:03 UTC 2024 - Steve Kowalik <steven.kowa...@suse.com> + +- Switch to pyproject macros. +- Less globs in %files. +- Clean up Python 2 leftovers. +- Edit python-pytest-profiling-no-six.patch to also drop the + install_requires. +- Add patch fix-mock-call.patch: + * Correct mocking call to be assert_called_with(). + +------------------------------------------------------------------- New: ---- fix-mock-call.patch BETA DEBUG BEGIN: New: install_requires. - Add patch fix-mock-call.patch: * Correct mocking call to be assert_called_with(). BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest-profiling.spec ++++++ --- /var/tmp/diff_new_pack.vNv0Dk/_old 2024-03-13 22:19:00.141208534 +0100 +++ /var/tmp/diff_new_pack.vNv0Dk/_new 2024-03-13 22:19:00.145208681 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pytest-profiling # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,22 +16,23 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_without python2 Name: python-pytest-profiling Version: 1.7.0 Release: 0 Summary: Profiling plugin for pytest License: MIT -Group: Development/Languages/Python URL: https://github.com/manahl/pytest-plugins Source: https://files.pythonhosted.org/packages/source/p/pytest-profiling/pytest-profiling-%{version}.tar.gz # PATCH-FEATURE-UPSTREAM pytest-fixtures-pr171-remove-mock.patch -- gh#man-group#pytest-plugins#171 Patch0: pytest-fixtures-pr171-remove-mock.patch # https://github.com/man-group/pytest-plugins/issues/209 Patch1: python-pytest-profiling-no-six.patch +# PATCH-FIX-UPSTREAM Based on gh#man-group/pytest-plugins#223 +Patch2: fix-mock-call.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools-git} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-gprof2dot @@ -42,9 +43,6 @@ BuildRequires: %{python_module more-itertools} BuildRequires: %{python_module pytest-virtualenv} BuildRequires: %{python_module pytest} -%if %{with python2} -BuildRequires: python2-mock -%endif # /SECTION %python_subpackages @@ -57,10 +55,10 @@ sed -i 's/more-itertools==5.0.0/more-itertools/' tests/integration/test_profile_integration.py %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -70,7 +68,7 @@ %files %{python_files} %doc CHANGES.md README.md %license LICENSE -%{python_sitelib}/pytest_profiling.py* +%{python_sitelib}/pytest_profiling.py %pycache_only %{python_sitelib}/__pycache__/pytest_profiling*.pyc -%{python_sitelib}/pytest_profiling-%{version}*-info +%{python_sitelib}/pytest_profiling-%{version}.dist-info ++++++ fix-mock-call.patch ++++++ >From 5054ade74d72cdcc2096ecbde3355253894a43a0 Mon Sep 17 00:00:00 2001 From: Steve Kowalik <ste...@wedontsleep.org> Date: Tue, 12 Mar 2024 15:12:00 +1100 Subject: [PATCH] pytest-profiling: Fix mock in test_writes_summary In Python < 3.12, MagicMock's will blindly call any method provided to them, which is masking a real issue in this testcase. The correct method is assert_called_with(), and even worse, one of the arguments provided isn't correct either. Correct the method call, and provide the correct argument. --- pytest-profiling/tests/unit/test_profile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Index: pytest-profiling-1.7.0/tests/unit/test_profile.py =================================================================== --- pytest-profiling-1.7.0.orig/tests/unit/test_profile.py +++ pytest-profiling-1.7.0/tests/unit/test_profile.py @@ -2,6 +2,7 @@ # the top-level code in pytest_profiling will be omitted from # coverage, so force it to be reloaded within this test unit under coverage +import os.path from importlib import reload # @UnresolvedImport import pytest_profiling @@ -49,8 +50,10 @@ def test_writes_summary(): with patch('pstats.Stats', return_value=stats) as Stats: plugin.pytest_sessionfinish(Mock(), Mock()) plugin.pytest_terminal_summary(terminalreporter) + combined = os.path.abspath( + os.path.join(os.path.curdir, "prof", "combined.prof")) assert 'Profiling' in terminalreporter.write.call_args[0][0] - assert Stats.called_with(stats, stream=terminalreporter) + Stats.assert_called_with(combined, stream=terminalreporter) def test_writes_summary_svg(): ++++++ python-pytest-profiling-no-six.patch ++++++ --- /var/tmp/diff_new_pack.vNv0Dk/_old 2024-03-13 22:19:00.177209861 +0100 +++ /var/tmp/diff_new_pack.vNv0Dk/_new 2024-03-13 22:19:00.181210009 +0100 @@ -36,4 +36,18 @@ from pytest_profiling import Profiling, pytest_addoption, pytest_configure +Index: pytest-profiling-1.7.0/setup.py +=================================================================== +--- pytest-profiling-1.7.0.orig/setup.py ++++ pytest-profiling-1.7.0/setup.py +@@ -22,8 +22,7 @@ classifiers = [ + 'Programming Language :: Python :: 3.7', + ] + +-install_requires = ['six', +- 'pytest', ++install_requires = ['pytest', + 'gprof2dot', + ] +