diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index b143b26ce0..e95adedcbc 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -50,7 +50,7 @@ jobs: python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))' BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report - coverage xml + coverage xml --ignore-errors if pgrep python; then pkill python; fi - name: Upload coverage uses: codecov/codecov-action@v1 @@ -93,7 +93,7 @@ jobs: python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))' BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report - coverage xml + coverage xml --ignore-errors if pgrep python; then pkill python; fi - name: Upload coverage uses: codecov/codecov-action@v1 @@ -192,7 +192,7 @@ jobs: ngc --version BUILD_MONAI=1 ./runtests.sh --build --coverage --pytype --unittests --disttests # unit tests with pytype checks, coverage report BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report - coverage xml + coverage xml --ignore-errors if pgrep python; then pkill python; fi - name: Upload coverage uses: codecov/codecov-action@v1 diff --git a/.github/workflows/pythonapp-gpu.yml b/.github/workflows/pythonapp-gpu.yml index 8a78a49f0c..e9a60408fb 100644 --- a/.github/workflows/pythonapp-gpu.yml +++ b/.github/workflows/pythonapp-gpu.yml @@ -142,7 +142,7 @@ jobs: # test the clang-format tool downloading once coverage run -m tests.clang_format_utils fi - coverage xml + coverage xml --ignore-errors if pgrep python; then pkill python; fi shell: bash - name: Upload coverage diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml index 4a2a46cfc1..ee3f275c64 100644 --- a/.github/workflows/setupapp.yml +++ b/.github/workflows/setupapp.yml @@ -61,7 +61,7 @@ jobs: python -c 'import torch; print(torch.rand(5, 3, device=torch.device("cuda:0")))' BUILD_MONAI=1 ./runtests.sh --build --coverage --unittests --disttests # unit tests with coverage report BUILD_MONAI=1 ./runtests.sh --build --coverage --net # integration tests with coverage report - coverage xml + coverage xml --ignore-errors if pgrep python; then pkill python; fi shell: bash - name: Upload coverage @@ -105,7 +105,7 @@ jobs: python -m pip list python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' BUILD_MONAI=1 ./runtests.sh --build --quick --unittests --disttests - coverage xml + coverage xml --ignore-errors - name: Upload coverage uses: codecov/codecov-action@v1 with: diff --git a/tests/test_video_datasets.py b/tests/test_video_datasets.py index 78a1215e09..ac9e151f63 100644 --- a/tests/test_video_datasets.py +++ b/tests/test_video_datasets.py @@ -11,7 +11,6 @@ import os import unittest -from contextlib import nullcontext from typing import Type, Union import torch @@ -49,15 +48,11 @@ def test_no_opencv_raises(self): @unittest.skipUnless(has_cv2, "OpenCV required.") def test_multiprocessing(self): - for multiprocessing in (True, False): - for num_workers in (0, 2): - # we only expect an error if num_workers > 0 and not using - # multiprocessing - expect_raise = num_workers == 2 and not multiprocessing - ds = self.get_ds(max_num_frames=100, multiprocessing=multiprocessing) - dl = DataLoader(ds, num_workers=num_workers, batch_size=2) - with self.assertRaises((TypeError, RuntimeError)) if expect_raise else nullcontext(): - _ = next(iter(dl)) + for num_workers in (0, 2): + multiprocessing = num_workers > 0 + ds = self.get_ds(max_num_frames=100, multiprocessing=multiprocessing) + dl = DataLoader(ds, num_workers=num_workers, batch_size=2) + _ = next(iter(dl)) @unittest.skipUnless(has_cv2, "OpenCV required.") def test_multiple_sources(self, should_match: bool = True):