Skip to content

Commit

Permalink
pytest: Don't use nose like syntax in graphene/relay/tests/test_custo…
Browse files Browse the repository at this point in the history
…m_global_id.py (#1539) (#1540)

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

Co-authored-by: Erik Wrede <[email protected]>
  • Loading branch information
tijuca and erikwrede authored Jun 13, 2024
1 parent 17d09c8 commit 88c3ec5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions graphene/relay/tests/test_custom_global_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestUUIDGlobalID:
def setup(self):
def setup_method(self):
self.user_list = [
{"id": uuid4(), "name": "First"},
{"id": uuid4(), "name": "Second"},
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down

0 comments on commit 88c3ec5

Please sign in to comment.