-
Notifications
You must be signed in to change notification settings - Fork 885
[ENH] in suite tests, add test for docstring examples #2374
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -366,12 +366,34 @@ | |
|
|
||
| object_type_filter = "forecaster_pytorch_v1" | ||
|
|
||
| def test_class_has_doctest_example(self, object_class): | ||
| """Check that the class has a docstring, with doctest example in it.""" | ||
| docstring = object_class.__doc__ | ||
|
|
||
| assert docstring is not None, f"{object_class.__name__} has no docstring" | ||
|
Check failure on line 373 in pytorch_forecasting/tests/test_all_estimators.py
|
||
| msg = f"{object_class.__name__} docstring has no doctest example" | ||
| assert ">>>" in docstring, msg | ||
|
Check failure on line 375 in pytorch_forecasting/tests/test_all_estimators.py
|
||
|
|
||
| def test_doctest_examples(self, object_class): | ||
| """Runs doctests for estimator class.""" | ||
| from skbase.utils.doctest_run import run_doctest | ||
|
|
||
| run_doctest(object_class, name=f"class {object_class.__name__}") | ||
|
|
||
| def test_pkg_has_doctest_example(self, object_pkg): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should v1 |
||
| """Check that the package has a docstring, with doctest example in it.""" | ||
| docstring = object_pkg.__doc__ | ||
|
|
||
| assert docstring is not None, f"{object_pkg.__name__} has no docstring" | ||
| msg = f"{object_pkg.__name__} docstring has no doctest example" | ||
| assert ">>>" in docstring, msg | ||
|
|
||
| def test_pkg_doctest_examples(self, object_pkg): | ||
| """Runs doctests for the estimator package class.""" | ||
| from skbase.utils.doctest_run import run_doctest | ||
|
|
||
| run_doctest(object_pkg, name=f"class {object_pkg.__name__}") | ||
|
|
||
| def test_integration( | ||
| self, | ||
| object_pkg, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.