Skip to content

Commit 8a3320c

Browse files
authored
Merge pull request #3986 from jasonb5/fix_unittest_py37
Fixes unittest raising error on py37, os.path.basename needed to be mocked. Test suite: test_case.py with py36,py37,py38,py39 Test baseline: n/a Test namelist changes: n/a Test status: bfb Fixes #3983 User interface changes?: n/a Update gh-pages html (Y/N)?: N
2 parents 2ae0ec9 + b54e0f2 commit 8a3320c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/srt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: [3.8, 3.9]
21+
python-version: [3.7, 3.8, 3.9]
2222
env:
2323
CC: mpicc
2424
FC: mpifort

scripts/lib/CIME/tests/test_case.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def test_check_case(self):
1717
case.check_all_input_data.assert_called_with(chksum=True)
1818

1919
@mock.patch("CIME.case.case_submit.lock_file")
20-
def test__submit(self, lock_file): # pylint: disable=unused-argument
20+
@mock.patch("CIME.case.case_submit.unlock_file")
21+
@mock.patch("os.path.basename")
22+
def test__submit(self, lock_file, unlock_file, basename): # pylint: disable=unused-argument
2123
case = mock.MagicMock()
2224

2325
case_submit._submit(case, chksum=True) # pylint: disable=protected-access

0 commit comments

Comments
 (0)