Skip to content

Use pytest instead of unittest in run_ctsm_py_tests#3761

Open
samsrabin wants to merge 5 commits intoESCOMP:b4b-devfrom
samsrabin:run_ctsm_py_tests-in-pytest
Open

Use pytest instead of unittest in run_ctsm_py_tests#3761
samsrabin wants to merge 5 commits intoESCOMP:b4b-devfrom
samsrabin:run_ctsm_py_tests-in-pytest

Conversation

@samsrabin
Copy link
Member

@samsrabin samsrabin commented Feb 14, 2026

Description of changes

This PR changes run_ctsm_py_tests to use pytest instead of unittest, enabling many modern features. One test file, test_unit_longitude.py, has been modified to use pytest's "parametrize" functionality as an example. Most of the changed lines in that file are just whitespace differences.

Existing run_ctsm_py_tests arguments have been ported to replicate the same functionality in pytest. Unknown arguments will be passed to pytest directly.

Also: Made it so that the tests can be called from anywhere in the checkout, instead of only python/.

Specific notes

Contributors other than yourself, if any: None

CTSM Issues Fixed:

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? No

Does this create a need to change or add documentation? Did you do so? No

Testing performed, if any: Python unit and system tests pass. New version finds the same number of tests as before.

@samsrabin samsrabin self-assigned this Feb 14, 2026
@samsrabin samsrabin added next this should get some attention in the next week or two. Normally each Thursday SE meeting. bfb bit-for-bit test: python Pass clm_pymods test suite plus Python sys/unit tests before merging labels Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bfb bit-for-bit next this should get some attention in the next week or two. Normally each Thursday SE meeting. test: python Pass clm_pymods test suite plus Python sys/unit tests before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant