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
This commit is contained in:
Carsten Schoenert 2024-03-17 10:03:48 +01:00
parent 5fb7b54377
commit 15a0bf21ba

View File

@ -9,7 +9,7 @@ from ...types import Int, ObjectType, Schema, String
class TestUUIDGlobalID: class TestUUIDGlobalID:
def setup(self): def setup_method(self):
self.user_list = [ self.user_list = [
{"id": uuid4(), "name": "First"}, {"id": uuid4(), "name": "First"},
{"id": uuid4(), "name": "Second"}, {"id": uuid4(), "name": "Second"},
@ -77,7 +77,7 @@ class TestUUIDGlobalID:
class TestSimpleGlobalID: class TestSimpleGlobalID:
def setup(self): def setup_method(self):
self.user_list = [ self.user_list = [
{"id": "my global primary key in clear 1", "name": "First"}, {"id": "my global primary key in clear 1", "name": "First"},
{"id": "my global primary key in clear 2", "name": "Second"}, {"id": "my global primary key in clear 2", "name": "Second"},
@ -140,7 +140,7 @@ class TestSimpleGlobalID:
class TestCustomGlobalID: class TestCustomGlobalID:
def setup(self): def setup_method(self):
self.user_list = [ self.user_list = [
{"id": 1, "name": "First"}, {"id": 1, "name": "First"},
{"id": 2, "name": "Second"}, {"id": 2, "name": "Second"},
@ -219,7 +219,7 @@ class TestCustomGlobalID:
class TestIncompleteCustomGlobalID: class TestIncompleteCustomGlobalID:
def setup(self): def setup_method(self):
self.user_list = [ self.user_list = [
{"id": 1, "name": "First"}, {"id": 1, "name": "First"},
{"id": 2, "name": "Second"}, {"id": 2, "name": "Second"},