1
0
python-graphene/support-pytest-8.patch
Steve Kowalik b63a003968 - Switch to autosetup and pyproject macros.
- Add patch support-pytest-8.patch:
  * Use correct setup/teardown method names.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-graphene?expand=0&rev=23
2024-08-27 04:21:26 +00:00

58 lines
2.2 KiB
Diff

From 15a0bf21ba5fe62de48a3a5be8058848e68ebe74 Mon Sep 17 00:00:00 2001
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sun, 17 Mar 2024 10:03:48 +0100
Subject: [PATCH] pytest: Don't use nose like syntax
The tests in test_custom_global_id.py use the old nose specific method
'setup(self)' which isn't supported anymore in Pytest 8+. The tests fail
with this error message without modification.
E pytest.PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
E graphene/relay/tests/test_custom_global_id.py::TestIncompleteCustomGlobalID::test_must_define_resolve_global_id is using nose-specific method: `setup(self)`
E To remove this warning, rename it to `setup_method(self)`
E See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
---
graphene/relay/tests/test_custom_global_id.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/graphene/relay/tests/test_custom_global_id.py b/graphene/relay/tests/test_custom_global_id.py
index c1bf0fb4b..8f7991409 100644
--- a/graphene/relay/tests/test_custom_global_id.py
+++ b/graphene/relay/tests/test_custom_global_id.py
@@ -9,7 +9,7 @@
class TestUUIDGlobalID:
- def setup(self):
+ def setup_method(self):
self.user_list = [
{"id": uuid4(), "name": "First"},
{"id": uuid4(), "name": "Second"},
@@ -77,7 +77,7 @@ def test_get_by_id(self):
class TestSimpleGlobalID:
- def setup(self):
+ def setup_method(self):
self.user_list = [
{"id": "my global primary key in clear 1", "name": "First"},
{"id": "my global primary key in clear 2", "name": "Second"},
@@ -140,7 +140,7 @@ def test_get_by_id(self):
class TestCustomGlobalID:
- def setup(self):
+ def setup_method(self):
self.user_list = [
{"id": 1, "name": "First"},
{"id": 2, "name": "Second"},
@@ -219,7 +219,7 @@ def test_get_by_id(self):
class TestIncompleteCustomGlobalID:
- def setup(self):
+ def setup_method(self):
self.user_list = [
{"id": 1, "name": "First"},
{"id": 2, "name": "Second"},