From 7b4078554a59cb9516d1f5408f3d2d3451cb0402 Mon Sep 17 00:00:00 2001 From: Alex Zwanenburg Date: Fri, 5 Apr 2024 17:47:42 +0200 Subject: [PATCH] Add coverage exclusions. --- .coveragerc | 10 +++++++++- test/import_image_test.py | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index 4a3bb9d4..e044af90 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,11 @@ [run] concurrency = multiprocessing -parallel = true \ No newline at end of file +parallel = true + +[report] +exclude_also = + raise ValueError + raise TypeError + raise NotImplementedError + raise FileNotFoundError + warnings.warn \ No newline at end of file diff --git a/test/import_image_test.py b/test/import_image_test.py index 8a4b388f..7f7f870c 100644 --- a/test/import_image_test.py +++ b/test/import_image_test.py @@ -15,7 +15,7 @@ CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) -def _convert_to_numpy(as_slice=False): +def _convert_to_numpy(as_slice=False): # pragma: no cover """ Helper script for converting NIfTI files to numpy for testing numpy-based imports. @@ -92,7 +92,7 @@ def _convert_to_numpy(as_slice=False): np.save(target_mask_file, arr=source_mask) -def _convert_to_flat_directory(): +def _convert_to_flat_directory(): # pragma: no cover """ Helper script for converting soft-tissue sarcoma imaging files to a flat directory. :return: