15
0
forked from pool/python-exam

Accepting request 1139835 from devel:languages:python

- 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.

OBS-URL: https://build.opensuse.org/request/show/1139835
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-exam?expand=0&rev=6
This commit is contained in:
2024-01-19 22:01:59 +00:00
committed by Git OBS Bridge
4 changed files with 49 additions and 5 deletions

View File

@@ -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)

View File

@@ -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']

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Jan 19 03:46:37 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- 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 <steven.kowalik@suse.com>

View File

@@ -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