Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate @test_helper decorator #998

Merged
merged 6 commits into from
Jul 31, 2023

Conversation

richardm-stripe
Copy link
Contributor

@richardm-stripe richardm-stripe commented Jul 28, 2023

The @test_helper decorator is somewhat awkward and will make it difficult to add type annotations.

This PR deprecates the decorator and

  1. adds a getter
  @property
  def test_helpers(self):
      return self.TestHelpers(self)
  1. sets ._resource_cls directly
MyResource.TestHelper._resource_cls = MyResource

and
3. Puts def _static_request and def _static_request_stream in the APIResourceTestHelpers parent class instead of being added dynamically by the decorator.

@richardm-stripe richardm-stripe marked this pull request as ready for review July 28, 2023 23:20
Copy link

@Silvrbckw Silvrbckw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and Commit

@richardm-stripe richardm-stripe merged commit e184de9 into master Jul 31, 2023
@richardm-stripe richardm-stripe deleted the richardm-undecoratize-test-helper branch July 31, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants