File migrate-to-setup-method.patch of Package python-librouteros

From a9349dfdc1d8e7a915567766e0d18b07544323dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Kostka?= <lukasz.g.kostka@gmail.com>
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', (
openSUSE Build Service is sponsored by