forked from pool/python-python-redmine
- Switch to pyproject and autosetup macros.
- Add patch support-python-312.patch, support Python 3.12. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-redmine?expand=0&rev=16
This commit is contained in:
45
support-python-312.patch
Normal file
45
support-python-312.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From b28beb9f0c1516d35037bb54adcb54dd803694e6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
||||
Date: Sat, 2 Mar 2024 14:45:08 +0100
|
||||
Subject: [PATCH] Replace `assertEquals()` to fix tests with Python 3.12 (#332)
|
||||
|
||||
---
|
||||
tests/test_managers.py | 4 ++--
|
||||
tests/test_redmine.py | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/test_managers.py b/tests/test_managers.py
|
||||
index dfacab2..44c2e8b 100644
|
||||
--- a/tests/test_managers.py
|
||||
+++ b/tests/test_managers.py
|
||||
@@ -125,7 +125,7 @@ def test_create_resource_with_stream_uploads(self):
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
warnings.simplefilter('always')
|
||||
issue = self.redmine.issue.create(project_id=1, subject='Foo', uploads=[{'path': stream}])
|
||||
- self.assertEquals(len(w), 1)
|
||||
+ self.assertEqual(len(w), 1)
|
||||
self.assertIs(w[0].category, exceptions.PerformanceWarning)
|
||||
self.assertEqual(issue.project_id, 1)
|
||||
self.assertEqual(issue.subject, 'Foo')
|
||||
@@ -166,7 +166,7 @@ def test_update_resource_with_stream_uploads(self):
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
warnings.simplefilter('always')
|
||||
self.assertEqual(self.redmine.issue.update(1, subject='Bar', uploads=[{'path': stream}]), True)
|
||||
- self.assertEquals(len(w), 1)
|
||||
+ self.assertEqual(len(w), 1)
|
||||
self.assertIs(w[0].category, exceptions.PerformanceWarning)
|
||||
|
||||
def test_update_resource_returns_none(self):
|
||||
diff --git a/tests/test_redmine.py b/tests/test_redmine.py
|
||||
index 46e456b..9384c18 100644
|
||||
--- a/tests/test_redmine.py
|
||||
+++ b/tests/test_redmine.py
|
||||
@@ -77,7 +77,7 @@ def test_successful_filestream_upload(self):
|
||||
with warnings.catch_warnings(record=True) as w:
|
||||
warnings.simplefilter('always')
|
||||
self.assertEqual(self.redmine.upload(StringIO(b'\xcf\x86oo'.decode('utf-8')))['token'], '456789')
|
||||
- self.assertEquals(len(w), 1)
|
||||
+ self.assertEqual(len(w), 1)
|
||||
self.assertIs(w[0].category, exceptions.PerformanceWarning)
|
||||
|
||||
@mock.patch('redminelib.open', mock.mock_open(), create=True)
|
Reference in New Issue
Block a user