diff --git a/fix-assertion-methods.patch b/fix-assertion-methods.patch new file mode 100644 index 0000000..5651295 --- /dev/null +++ b/fix-assertion-methods.patch @@ -0,0 +1,19 @@ +Index: exam-0.10.6/tests/test_asserts.py +=================================================================== +--- exam-0.10.6.orig/tests/test_asserts.py ++++ exam-0.10.6/tests/test_asserts.py +@@ -52,12 +52,12 @@ class AssertChangesMixin(Exam, TestCase) + + def test_raises_assertion_error_if_value_changes(self): + msg = 'Value changed from 0 to 1' +- with self.assertRaisesRegexp(AssertionError, msg): ++ with self.assertRaisesRegex(AssertionError, msg): + with self.assertDoesNotChange(len, self.thing): + self.thing.append(1) + + def test_assertion_error_mentions_unexpected_result_at_after(self): + msg = 'Value changed to 1, not 3' +- with self.assertRaisesRegexp(AssertionError, msg): ++ with self.assertRaisesRegex(AssertionError, msg): + with self.assertChanges(len, self.thing, after=3): + self.thing.append(1) diff --git a/no-mock.patch b/no-mock.patch index 23ccaec..8ddbdca 100644 --- a/no-mock.patch +++ b/no-mock.patch @@ -68,3 +68,16 @@ Index: exam-0.10.6/tests/test_objects.py from tests import TestCase from exam.objects import always, noop +Index: exam-0.10.6/setup.py +=================================================================== +--- exam-0.10.6.orig/setup.py ++++ exam-0.10.6/setup.py +@@ -8,7 +8,7 @@ try: + except ImportError: + pass + +-install_requires = ['mock'] ++install_requires = [] + lint_requires = ['pep8', 'pyflakes'] + tests_require = ['unittest'] + diff --git a/python-exam.changes b/python-exam.changes index 8aab272..e7c81e7 100644 --- a/python-exam.changes +++ b/python-exam.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jan 19 03:46:37 UTC 2024 - Steve Kowalik + +- Switch to pyproject macros. +- Stop using greedy globs in %files. +- Add patch fix-assertion-methods.patch: + * Correct test assertion methods. +- Refresh no-mock.patch, to remove it from install_requires. + ------------------------------------------------------------------- Mon Mar 14 05:55:32 UTC 2022 - Steve Kowalik diff --git a/python-exam.spec b/python-exam.spec index 3aeda6c..c3e84e4 100644 --- a/python-exam.spec +++ b/python-exam.spec @@ -1,7 +1,7 @@ # # spec file for package python-exam # -# 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,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-exam Version: 0.10.6 Release: 0 @@ -28,8 +27,11 @@ Source1: https://raw.githubusercontent.com/Fluxx/exam/master/LICENSE # https://github.com/Fluxx/exam/pull/50 Patch0: remove_nose.patch Patch1: no-mock.patch +Patch2: fix-assertion-methods.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Recommends: python-pep8 @@ -49,10 +51,10 @@ conventions and adhering to the unit testing interface. cp %{SOURCE1} . %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -61,6 +63,7 @@ cp %{SOURCE1} . %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/exam +%{python_sitelib}/exam-%{version}.dist-info %changelog