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

Add more unit tests for routines in common.py #465

Merged
merged 2 commits into from
Apr 10, 2023

Conversation

mkavulich
Copy link
Collaborator

This PR is a demo to begin adding more unit test coverage to the CCPP-framework. Since a unit test was recently added for the test_string_to_python_identifier function in common.py, I added unit tests for the remaining functions in that file.

To run these unit tests, simply navigate to the test/unit_tests directory and run the script (with Python 3.7 or higher):

python test_common.py 
.....
----------------------------------------------------------------------
Ran 5 tests in 0.023s

OK

User interface changes?: No

Fixes: No issue specific to this change. This test focuses on the ccpp_prebuild portion of code, but should be a stepping stone to a number of issues relating to capgen unit tests.

Testing:
unit tests: All passed

Copy link
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

Although I have a requested change, it is more of a suggestion.

test/unit_tests/test_common.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Thanks for adding more tests to the framework! I agree with @gold2718's suggestion. The "That dog won't hunt, Monsignor" test is hilarious :-)

Commit second suggestion; logging.CRITICAL was only made default in python 3.7 and I want to be cautious on back-compatibility

Co-authored-by: goldy <[email protected]>
@mkavulich mkavulich merged commit 625a456 into NCAR:main Apr 10, 2023
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