Skip to content

Commit

Permalink
Remove deprecated test_helper decorator (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe authored Aug 16, 2023
1 parent 816dc30 commit 5a844be
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
1 change: 0 additions & 1 deletion stripe/api_resources/abstract/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from stripe.api_resources.abstract.custom_method import custom_method

from stripe.api_resources.abstract.test_helpers import (
test_helpers,
APIResourceTestHelpers,
)

Expand Down
25 changes: 0 additions & 25 deletions stripe/api_resources/abstract/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from stripe import error
from urllib.parse import quote_plus
from stripe.api_resources.abstract import APIResource


class APIResourceTestHelpers:
Expand Down Expand Up @@ -53,27 +52,3 @@ def instance_url(self):
base = self.class_url()
extn = quote_plus(id)
return "%s/%s" % (base, extn)


# TODO (next major)
def test_helpers(cls):
"""
The test_helpers decorator is deprecated and will be removed in a future version
of the library.
"""

def test_helpers_getter(self):
return self.TestHelpers(self)

if not issubclass(cls, APIResource):
raise ValueError(
"Could not apply @test_helpers decorator to %r."
" The class should a subclass of APIResource." % cls
)

cls.TestHelpers._resource_cls = cls
cls.TestHelpers._static_request = cls._static_request
cls.TestHelpers._static_request_stream = cls._static_request_stream

cls.test_helpers = property(test_helpers_getter)
return cls

0 comments on commit 5a844be

Please sign in to comment.