Skip to content
Snippets Groups Projects
Commit af809399 authored by Maik Nijhuis's avatar Maik Nijhuis
Browse files

Fix black version to 24.x / Support pytest 8.0

parent 740d8703
No related branches found
No related tags found
No related merge requests found
......@@ -1003,9 +1003,15 @@ if(BUILD_TESTING)
string(REGEX REPLACE ".*${TEST}.py::" "" PYTEST ${PYTEST})
add_test(
NAME ${TEST}::${PYTEST}
# Without the explicit --rootdir argument, pytest uses
# ${CMAKE_SOURCE_DIR} as root directory. pytest >= 8.0 then tries
# loading ${CMAKE_SOURCE_DIR}/pythondp3/__init__.py and fails,
# since it only works in the the pseudo install directory created
# by pythondp3/CMakeLists.txt.
COMMAND
python3 -m pytest --exitfirst -v -k ${PYTEST}
--junitxml=${CMAKE_BINARY_DIR}/pytest_${TEST}_${PYTEST}.xml
--rootdir=${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${TEST}.py)
set_tests_properties(${TEST}::${PYTEST} PROPERTIES LABELS "${LABELS}")
endforeach()
......@@ -1013,9 +1019,11 @@ if(BUILD_TESTING)
# Create one ctest for all sub-tests in a python test file.
add_test(
NAME ${TEST}
# The comment in add_test above explains why --rootdir is needed.
COMMAND
python3 -m pytest --exitfirst -v
--junitxml=${CMAKE_BINARY_DIR}/pytest_${TEST}.xml
--rootdir=${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${TEST}.py)
set_tests_properties(${TEST} PROPERTIES LABELS "${LABELS}")
endif()
......
......@@ -731,10 +731,12 @@ def test_dd_solution_intervals(solutions_per_direction):
]
try:
check_output(
base_command
if solutions_per_direction is None
else base_command
+ [f"ddecal.solutions_per_direction={solutions_per_direction}"],
(
base_command
if solutions_per_direction is None
else base_command
+ [f"ddecal.solutions_per_direction={solutions_per_direction}"]
),
stderr=STDOUT,
)
except CalledProcessError as e:
......
......@@ -78,7 +78,7 @@ RUN wget -nv -O /WSRT_Measures.ztar ftp://ftp.astron.nl/outgoing/Measures/WSRT_M
&& rm /WSRT_Measures.ztar
# Install pip dependencies
RUN pip3 install \
black \
black~=24.0 \
cmake-format \
h5py \
pytest \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment