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

Automate simple tests cases #2751

Open
johnnv1 opened this issue Jan 23, 2024 · 0 comments
Open

Automate simple tests cases #2751

johnnv1 opened this issue Jan 23, 2024 · 0 comments
Labels
code heatlh 💊 Improvement the package code health Difficulty: medium Describes the difficulty of an issue to be solved help wanted Extra attention is needed

Comments

@johnnv1
Copy link
Member

johnnv1 commented Jan 23, 2024

          not for this pull request, but to ease development we could consider to somehow automate the old abstract methods (maybe with some decorators)

Originally posted by @edgarriba in #2745 (comment)

just for the record, the old methods that we used in the base test class as abstracts were:

    def test_smoke(self, device, dtype):
        # test the function with different parameters arguments, to check if the function at least runs with all the
        # arguments allowed.
        pass

    def test_exception(self, device, dtype):
        # tests the exceptions which can occur on your function

        # example of how to properly test your exceptions
        # with pytest.raises(<raised Error>) as errinfo:
        #     your_function(<set of parameters that raise the error>)
        # assert '<msg of error>' in str(errinfo)

        pass

    def test_cardinality(self, device, dtype):
        # test if with different parameters the shape of the output is the expected
        pass

    def test_feature_foo(self, device, dtype):
        # test basic functionality
        pass

    def test_feature_bar(self, device, dtype):
        # test another functionality
        pass

    def test_gradcheck(self, device):
        # test the functionality gradients
        # Uses `self.gradcheck(...)`
        pass
@johnnv1 johnnv1 added help wanted Extra attention is needed Difficulty: medium Describes the difficulty of an issue to be solved code heatlh 💊 Improvement the package code health labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code heatlh 💊 Improvement the package code health Difficulty: medium Describes the difficulty of an issue to be solved help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant