Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-exam for openSUSE:Factory checked in at 2026-04-26 21:12:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-exam (Old) and /work/SRC/openSUSE:Factory/.python-exam.new.11940 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-exam" Sun Apr 26 21:12:13 2026 rev:7 rq:1349361 version:0.10.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-exam/python-exam.changes 2024-01-19 23:02:18.682281651 +0100 +++ /work/SRC/openSUSE:Factory/.python-exam.new.11940/python-exam.changes 2026-04-26 21:15:03.694606991 +0200 @@ -1,0 +2,5 @@ +Sun Apr 26 04:59:06 UTC 2026 - Marius Grossu <[email protected]> + +- Added fix-python314.patch: to fix the test runs for latest python + +------------------------------------------------------------------- New: ---- fix-python314.patch ----------(New B)---------- New: - Added fix-python314.patch: to fix the test runs for latest python ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-exam.spec ++++++ --- /var/tmp/diff_new_pack.oV3CB5/_old 2026-04-26 21:15:04.218628326 +0200 +++ /var/tmp/diff_new_pack.oV3CB5/_new 2026-04-26 21:15:04.222628490 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-exam # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,7 @@ Patch0: remove_nose.patch Patch1: no-mock.patch Patch2: fix-assertion-methods.patch +Patch3: fix-python314.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} ++++++ fix-python314.patch ++++++ Index: exam-0.10.6/exam/asserts.py =================================================================== --- exam-0.10.6.orig/exam/asserts.py +++ exam-0.10.6/exam/asserts.py @@ -49,7 +49,15 @@ class ChangeWatcher(object): self.__raise_postcondition_error('invalid') def __apply(self): - return self.check(*self.args, **self.kwargs) + # In newer Python versions method binding in Exam can incorrectly pass the test case instance as `check` + # Detect and correct this situation. + check = self.check + + # If check is not callable but looks like a TestCase, fallback + if not callable(check) and hasattr(check, '__class__'): + raise TypeError(f"check must be callable, got {type(check)}") + + return check(*self.args, **self.kwargs) def __raise_postcondition_error(self, key): message = self.POSTCONDITION_FAILURE_MESSAGE[key] Index: exam-0.10.6/exam/cases.py =================================================================== --- exam-0.10.6.orig/exam/cases.py +++ exam-0.10.6/exam/cases.py @@ -55,5 +55,7 @@ class Exam(AssertsMixin): generators = (value(self) for _, value in self.__attrs_of_type(around)) with MultipleGeneratorsContextManager(*generators): self.__run_hooks(before) - getattr(super(Exam, self), 'run', noop)(*args, **kwargs) + # in newer Python3.11+: TestCase.run only accepts result=None) + result = args[0] if args else None + super(Exam, self).run(result) self.__run_hooks(after) Index: exam-0.10.6/exam/mock.py =================================================================== --- exam-0.10.6.orig/exam/mock.py +++ exam-0.10.6/exam/mock.py @@ -16,10 +16,10 @@ class Mock(BaseMock): assert not call(*args, **kwargs) == self.call_args def assert_not_called_once_with(self, *args, **kwargs): - assert len(self.__calls_matching(*args, **kwargs)) is not 1 + assert len(self.__calls_matching(*args, **kwargs)) != 1 def assert_not_any_call(self, *args, **kwargs): - assert len(self.__calls_matching(*args, **kwargs)) is 0 + assert len(self.__calls_matching(*args, **kwargs)) == 0 def __calls_matching(self, *args, **kwargs): calls_match = lambda other_call: call(*args, **kwargs) == other_call
