diff --git a/migrate-to-setup-method.patch b/migrate-to-setup-method.patch new file mode 100644 index 0000000..478b723 --- /dev/null +++ b/migrate-to-setup-method.patch @@ -0,0 +1,106 @@ +From a9349dfdc1d8e7a915567766e0d18b07544323dc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C5=81ukasz=20Kostka?= +Date: Thu, 22 Jun 2023 14:55:54 +0200 +Subject: [PATCH] Migrate to setup_method + +https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose +--- + tests/unit/test_api.py | 2 +- + tests/unit/test_connections.py | 2 +- + tests/unit/test_path.py | 2 +- + tests/unit/test_protocol.py | 6 +++--- + tests/unit/test_query.py | 4 ++-- + 5 files changed, 8 insertions(+), 8 deletions(-) + +Index: librouteros-3.2.1/tests/unit/test_api.py +=================================================================== +--- librouteros-3.2.1.orig/tests/unit/test_api.py ++++ librouteros-3.2.1/tests/unit/test_api.py +@@ -37,7 +37,7 @@ def test_compose_word(word_pair): + + class Test_Api: + +- def setup(self): ++ def setup_method(self): + self.api = Api(protocol=MagicMock()) + + @patch.object(Api, 'readResponse') +Index: librouteros-3.2.1/tests/unit/test_connections.py +=================================================================== +--- librouteros-3.2.1.orig/tests/unit/test_connections.py ++++ librouteros-3.2.1/tests/unit/test_connections.py +@@ -14,7 +14,7 @@ from librouteros.exceptions import ( + + class Test_SocketTransport: + +- def setup(self): ++ def setup_method(self): + self.transport = SocketTransport(sock=MagicMock(spec=socket)) + + def test_calls_socket_close(self): +Index: librouteros-3.2.1/tests/unit/test_path.py +=================================================================== +--- librouteros-3.2.1.orig/tests/unit/test_path.py ++++ librouteros-3.2.1/tests/unit/test_path.py +@@ -19,7 +19,7 @@ def test_api_path_returns_Path(): + + class Test_Path: + +- def setup(self): ++ def setup_method(self): + self.path = Path( + path='/interface', + api=MagicMock(), +Index: librouteros-3.2.1/tests/unit/test_protocol.py +=================================================================== +--- librouteros-3.2.1.orig/tests/unit/test_protocol.py ++++ librouteros-3.2.1/tests/unit/test_protocol.py +@@ -18,7 +18,7 @@ from librouteros.exceptions import ( + + class Test_Decoder: + +- def setup(self): ++ def setup_method(self): + self.decoder = Decoder() + self.decoder.encoding = 'ASCII' + +@@ -51,7 +51,7 @@ class Test_Decoder: + + class Test_Encoder: + +- def setup(self): ++ def setup_method(self): + self.encoder = Encoder() + self.encoder.encoding = 'ASCII' + +@@ -98,7 +98,7 @@ class Test_Encoder: + + class Test_ApiProtocol: + +- def setup(self): ++ def setup_method(self): + self.protocol = ApiProtocol( + transport=MagicMock(spec=SocketTransport), + encoding='utf-8', +Index: librouteros-3.2.1/tests/unit/test_query.py +=================================================================== +--- librouteros-3.2.1.orig/tests/unit/test_query.py ++++ librouteros-3.2.1/tests/unit/test_query.py +@@ -11,7 +11,7 @@ from librouteros.query import ( + + class Test_Query: + +- def setup(self): ++ def setup_method(self): + self.query = Query( + path=MagicMock(), + api=MagicMock(), +@@ -43,7 +43,7 @@ class Test_Query: + + class Test_Key: + +- def setup(self): ++ def setup_method(self): + self.key = Key(name='key_name', ) + + @pytest.mark.parametrize('param, expected', ( diff --git a/python-librouteros.changes b/python-librouteros.changes index 4ae2981..cce0bdc 100644 --- a/python-librouteros.changes +++ b/python-librouteros.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Aug 20 04:27:52 UTC 2024 - Steve Kowalik + +- Add patch migrate-to-setup-method.patch: + * Migrate to using setup_method(). + ------------------------------------------------------------------- Tue Jan 23 06:26:04 UTC 2024 - Steve Kowalik diff --git a/python-librouteros.spec b/python-librouteros.spec index 408ca5d..c09529a 100644 --- a/python-librouteros.spec +++ b/python-librouteros.spec @@ -24,6 +24,8 @@ Summary: Python implementation of MikroTik RouterOS API License: GPL-2.0-or-later URL: https://github.com/luqasz/librouteros Source: https://github.com/luqasz/librouteros/archive/%{version}.tar.gz#/librouteros-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#luqasz/librouteros#a9349dfdc1d8e7a915567766e0d18b07544323dc +Patch0: migrate-to-setup-method.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel}