forked from pool/python-bugzillatools
- Add python312.patch to fix tests with python3.12
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bugzillatools?expand=0&rev=20
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 20 18:37:51 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Add python312.patch to fix tests with python3.12
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 18 22:57:57 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-bugzillatools
|
||||
#
|
||||
# Copyright (c) 2020 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
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
|
||||
%define oldpython python
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-bugzillatools
|
||||
Version: 0.5.5
|
||||
Release: 0
|
||||
@@ -31,6 +30,8 @@ Patch0: 0001-Working-on-both-2.7-and-3.4.patch
|
||||
# Some more py3k fixes
|
||||
# https://github.com/rawrgulmuffins/bugzillatools/pull/26
|
||||
Patch1: no-bzrlib-py3k.patch
|
||||
# PATCH-FIX-OPENSUSE python312.patch
|
||||
Patch2: python312.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
|
||||
102
python312.patch
Normal file
102
python312.patch
Normal file
@@ -0,0 +1,102 @@
|
||||
Index: bugzillatools-0.5.5/bzlib/test_bug.py
|
||||
===================================================================
|
||||
--- bugzillatools-0.5.5.orig/bzlib/test_bug.py
|
||||
+++ bugzillatools-0.5.5/bzlib/test_bug.py
|
||||
@@ -27,9 +27,9 @@ class BugTestCase(unittest.TestCase):
|
||||
self.bz = bugzilla.Bugzilla('http://bugzilla.example.com/', 'u', 'p')
|
||||
|
||||
def test_search(self):
|
||||
- with self.assertRaisesRegexp(TypeError, r'\bfoobar\b'):
|
||||
+ with self.assertRaisesRegex(TypeError, r'\bfoobar\b'):
|
||||
bug.Bug.search(self.bz, foobar='baz')
|
||||
- with self.assertRaisesRegexp(TypeError, r'\bfoobar\b'):
|
||||
+ with self.assertRaisesRegex(TypeError, r'\bfoobar\b'):
|
||||
bug.Bug.search(self.bz, not_foobar='baz')
|
||||
fields = frozenset([
|
||||
'alias', 'assigned_to', 'component', 'creation_time', 'creator',
|
||||
Index: bugzillatools-0.5.5/bzlib/test_bugzilla.py
|
||||
===================================================================
|
||||
--- bugzillatools-0.5.5.orig/bzlib/test_bugzilla.py
|
||||
+++ bugzillatools-0.5.5/bzlib/test_bugzilla.py
|
||||
@@ -86,13 +86,13 @@ class URLTestCase(unittest.TestCase):
|
||||
|
||||
# no trailing '/'
|
||||
bz = bugzilla.Bugzilla('http://' + host, 'u', 'p')
|
||||
- self.assertEquals(bz.server._ServerProxy__host, host)
|
||||
- self.assertEquals(bz.server._ServerProxy__handler, '/xmlrpc.cgi')
|
||||
+ self.assertEqual(bz.server._ServerProxy__host, host)
|
||||
+ self.assertEqual(bz.server._ServerProxy__handler, '/xmlrpc.cgi')
|
||||
|
||||
# trailing '/'
|
||||
bz = bugzilla.Bugzilla('http://' + host + '/', 'u', 'p')
|
||||
- self.assertEquals(bz.server._ServerProxy__host, host)
|
||||
- self.assertEquals(bz.server._ServerProxy__handler, '/xmlrpc.cgi')
|
||||
+ self.assertEqual(bz.server._ServerProxy__host, host)
|
||||
+ self.assertEqual(bz.server._ServerProxy__handler, '/xmlrpc.cgi')
|
||||
|
||||
|
||||
class FromConfigTestCase(unittest.TestCase):
|
||||
@@ -120,7 +120,7 @@ class FromConfigTestCase(unittest.TestCa
|
||||
"""Test that all mandatory args are checked."""
|
||||
mandatory_args = set(['server', 'url', 'user', 'password'])
|
||||
for args in itertools.combinations(mandatory_args, 2):
|
||||
- with self.assertRaisesRegexp(TypeError, '[Mm]andatory'):
|
||||
+ with self.assertRaisesRegex(TypeError, '[Mm]andatory'):
|
||||
bugzilla.Bugzilla.from_config(
|
||||
self._conf,
|
||||
**{k: None for k in args}
|
||||
Index: bugzillatools-0.5.5/bzlib/test_ui.py
|
||||
===================================================================
|
||||
--- bugzillatools-0.5.5.orig/bzlib/test_ui.py
|
||||
+++ bugzillatools-0.5.5/bzlib/test_ui.py
|
||||
@@ -24,31 +24,31 @@ class FilterTestCase(unittest.TestCase):
|
||||
|
||||
def test_filter_int(self):
|
||||
# 'start' arg
|
||||
- with self.assertRaisesRegexp(ui.InvalidInputError, 'value too small'):
|
||||
+ with self.assertRaisesRegex(ui.InvalidInputError, 'value too small'):
|
||||
ui.filter_int('0', start=1)
|
||||
self.assertEqual(ui.filter_int('0', start=0), 0)
|
||||
|
||||
# 'stop' arg
|
||||
- with self.assertRaisesRegexp(ui.InvalidInputError, 'value too large'):
|
||||
+ with self.assertRaisesRegex(ui.InvalidInputError, 'value too large'):
|
||||
ui.filter_int('2', stop=2)
|
||||
self.assertEqual(ui.filter_int('1', stop=2), 1)
|
||||
|
||||
# bogus input
|
||||
- with self.assertRaisesRegexp(ui.InvalidInputError, 'not an int'):
|
||||
+ with self.assertRaisesRegex(ui.InvalidInputError, 'not an int'):
|
||||
ui.filter_int('a')
|
||||
|
||||
# default
|
||||
- with self.assertRaisesRegexp(ui.InvalidInputError, 'not an int'):
|
||||
+ with self.assertRaisesRegex(ui.InvalidInputError, 'not an int'):
|
||||
ui.filter_int('')
|
||||
self.assertEqual(ui.filter_int('', default=100), 100)
|
||||
|
||||
def test_filter_list(self):
|
||||
# no filter
|
||||
- with self.assertRaisesRegexp(TypeError, r'\bfilter\b'):
|
||||
+ with self.assertRaisesRegex(TypeError, r'\bfilter\b'):
|
||||
ui.filter_list('1 2 3')
|
||||
|
||||
# duplicates
|
||||
- with self.assertRaisesRegexp(
|
||||
+ with self.assertRaisesRegex(
|
||||
ui.InvalidInputError,
|
||||
'duplicate values are not allowed'
|
||||
):
|
||||
@@ -77,10 +77,10 @@ class FilterTestCase(unittest.TestCase):
|
||||
)
|
||||
|
||||
# min, max allowed
|
||||
- with self.assertRaisesRegexp(ui.InvalidInputError, 'too few'):
|
||||
+ with self.assertRaisesRegex(ui.InvalidInputError, 'too few'):
|
||||
ui.filter_list('1 2 3', filter=ui.filter_int, min_allowed=4)
|
||||
ui.filter_list('1 2 3', filter=ui.filter_int, min_allowed=3)
|
||||
- with self.assertRaisesRegexp(ui.InvalidInputError, 'too many'):
|
||||
+ with self.assertRaisesRegex(ui.InvalidInputError, 'too many'):
|
||||
ui.filter_list('1 2 3', filter=ui.filter_int, max_allowed=2)
|
||||
ui.filter_list('1 2 3', filter=ui.filter_int, max_allowed=3)
|
||||
|
||||
Reference in New Issue
Block a user