-
-
Notifications
You must be signed in to change notification settings - Fork 4
Remove image_height and image_width attributes; test that every method/attribute has docs
#77
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
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 |
|---|---|---|
|
|
@@ -72,3 +72,26 @@ def test_api_test_class_covers_all_attributes_and_only_those_attributes(): | |
| "ImageWidgetAPITest does not access these " | ||
| f"attributes/methods:\n{missing_attributes_msg}\n" | ||
| ) | ||
|
|
||
|
|
||
| def test_every_method_attribute_has_docstring(): | ||
|
||
| """ | ||
| Check that every method and attribute in the protocol has a docstring. | ||
| """ | ||
| from astro_image_display_api import ImageViewerInterface | ||
|
|
||
| all_methods_and_attributes = ImageViewerInterface.__protocol_attrs__ | ||
|
|
||
| method_attrs_no_docs = [] | ||
|
|
||
| for method in all_methods_and_attributes: | ||
| attr = getattr(ImageViewerInterface, method) | ||
| # Make list of methods and attributes that have no docstring | ||
| # and assert that list is empty at the end of the test. | ||
| if not attr.__doc__: | ||
| method_attrs_no_docs.append(method) | ||
|
|
||
| assert not method_attrs_no_docs, ( | ||
| "The following methods and attributes have no docstring:\n\t" | ||
| f"{'\n\t'.join(method_attrs_no_docs)}" | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.