-
Notifications
You must be signed in to change notification settings - Fork 37
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
TST: Clean warnings #1129
TST: Clean warnings #1129
Conversation
Added a test for logging messages, warnings, and errors that may occur in Instrument `clean` methods. Also tests to see if the clean level has been reset correctly.
Added level resetting, logging messages, warnings, and errors as potential outputs to the clean method for test instruments. Also added a unit test for each of these elements.
Updated the new instrument instructions for the clean method and `_clean_warn` test variable.
Updated the changelog with a description of this pull request.
Updated the reference style in the docs.
Fixing bug in reference format.
Fixed logic in clean method, allowing key search only if input is a dict.
|
Updated example for `_clean_warn` in docs to include inst_id and tag.
Removed lines that cannot be reached, as the clean method doesn't run if the clean level is 'none'.
Updated the `_clean_warn` format to accept a list of tuples.
Moved the discussion of the new clean_warn test attribute to its own section and updated the reference.
Added a missing quotation mark.
Fixed the dict access for the expected clean warnings.
Ensure the strict time flag is not raising a ValueError when testing the clean warning messages.
Cannot assess other warnings when an error is raised, only test multiple non-fatal warnings.
Improved the logging error message in the clean warning test to be more useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I would suggest restructuring so that tests where nothing is run are skipped to be consistent with similar tests elsewhere.
Fixed spelling and line length in the docs.
Improved the clean warning test by: - Creating a function for testing/setting the strict time flag, - Removing 'none' from the clean level parametrization, - Fixing the docstrings, - Adding more comments, and - Adding pytest skip statements.
The decrease in coverage is consistent with tests not being skipped and edge cases for ecosystem packages not being triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generalized function as written will cause a change in test_load
Fixed comments to be accurate. Co-authored-by: Jeff Klenzing <[email protected]>
Allow the strict flag function to run with or without the clean method.
Rename the test function as per discussion. Co-authored-by: Jeff Klenzing <[email protected]>
Description
Addresses #1009 by adding a general test triggered by an optional testing variable to the standard set of Instrument tests. Adapted the clean method in the test instruments to run all potential iterations of the allowed behaviour, which includes:
Updated the documentation to describe how this testing should be done.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Added unit tests. Also added this line to
ace_epam.py
in pysatSpaceWeather and ran the local unit tests.Test Configuration:
Checklist:
develop
(notmain
) branchCHANGELOG.md
, summarizing the changesIf this is a release PR, replace the first item of the above checklist with the release
checklist on the wiki: https://github.com/pysat/pysat/wiki/Checklist-for-Release