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

Address API change in Python 3.12 unittest module #4852

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions testsuite/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ function(python_test)
add_test(${TEST_NAME} ${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${TEST_FILE_CONFIGURED} ${TEST_ARGUMENTS})
endif()
set_tests_properties(${TEST_NAME} PROPERTIES PROCESSORS ${TEST_NUM_PROC}
DEPENDS "${TEST_DEPENDS}")

if(${TEST_GPU_SLOTS} GREATER 0 AND ESPRESSO_BUILD_WITH_CUDA)
set_property(TEST ${TEST_NAME} PROPERTY RESOURCE_GROUPS
Expand All @@ -117,7 +115,10 @@ function(python_test)
if(${TEST_NUM_PROC} EQUAL 3)
list(APPEND TEST_LABELS "parallel_odd")
endif()
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${TEST_LABELS}")

set_tests_properties(
${TEST_NAME} PROPERTIES PROCESSORS ${TEST_NUM_PROC} SKIP_RETURN_CODE 5
DEPENDS "${TEST_DEPENDS}" LABELS "${TEST_LABELS}")

set(python_tests ${python_tests} ${TEST_FILE_CONFIGURED} PARENT_SCOPE)
endfunction(python_test)
Expand Down
6 changes: 3 additions & 3 deletions testsuite/scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ macro(PYTHON_SCRIPTS_TEST)
string(REGEX REPLACE "^test_" "${TEST_TYPE}_" TEST_NAME ${TEST_NAME})
add_test(${TEST_NAME} ${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${TEST_FILE_CONFIGURED})
set_tests_properties(${TEST_NAME} PROPERTIES FIXTURES_REQUIRED
IMPORTLIB_WRAPPER)
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${TEST_LABELS}")
set_tests_properties(
${TEST_NAME} PROPERTIES FIXTURES_REQUIRED IMPORTLIB_WRAPPER
SKIP_RETURN_CODE 5 LABELS "${TEST_LABELS}")
if("gpu" IN_LIST TEST_LABELS AND ESPRESSO_BUILD_WITH_CUDA)
set_tests_properties(${TEST_NAME} PROPERTIES RESOURCE_LOCK GPU)
endif()
Expand Down
5 changes: 3 additions & 2 deletions testsuite/scripts/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ endfunction(BENCHMARK_TEST)
# configure Python module importlib_wrapper.py
add_test(importlib_wrapper ${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${TEST_FILE_CONFIGURED_IMPORTLIB_WRAPPER})
set_tests_properties(importlib_wrapper PROPERTIES FIXTURES_SETUP
IMPORTLIB_WRAPPER)
set_tests_properties(
importlib_wrapper PROPERTIES FIXTURES_SETUP IMPORTLIB_WRAPPER
SKIP_RETURN_CODE 5)
set(benchmarks_tests ${benchmarks_tests}
${TEST_FILE_CONFIGURED_IMPORTLIB_WRAPPER} PARENT_SCOPE)
configure_file(../importlib_wrapper.py
Expand Down
5 changes: 3 additions & 2 deletions testsuite/scripts/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ endfunction(SAMPLE_TEST)
# configure Python module importlib_wrapper.py
add_test(importlib_wrapper ${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${TEST_FILE_CONFIGURED_IMPORTLIB_WRAPPER})
set_tests_properties(importlib_wrapper PROPERTIES FIXTURES_SETUP
IMPORTLIB_WRAPPER)
set_tests_properties(
importlib_wrapper PROPERTIES FIXTURES_SETUP IMPORTLIB_WRAPPER
SKIP_RETURN_CODE 5)
set(samples_tests ${samples_tests} ${TEST_FILE_CONFIGURED_IMPORTLIB_WRAPPER}
PARENT_SCOPE)
configure_file(../importlib_wrapper.py
Expand Down
6 changes: 3 additions & 3 deletions testsuite/scripts/tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ add_test(importlib_wrapper ${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${TEST_FILE_CONFIGURED_IMPORTLIB_WRAPPER})
add_test(convert ${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${CMAKE_CURRENT_BINARY_DIR}/test_convert.py)
set_tests_properties(importlib_wrapper PROPERTIES FIXTURES_SETUP
IMPORTLIB_WRAPPER)
set_tests_properties(convert PROPERTIES FIXTURES_SETUP IMPORTLIB_WRAPPER)
set_tests_properties(
importlib_wrapper convert PROPERTIES FIXTURES_SETUP IMPORTLIB_WRAPPER
SKIP_RETURN_CODE 5)
set(tutorials_tests ${tutorials_tests} ${TEST_FILE_CONFIGURED_IMPORTLIB_WRAPPER}
PARENT_SCOPE)
configure_file(../importlib_wrapper.py
Expand Down