diff --git a/dali/test/python/checkpointing/test_dali_checkpointing.py b/dali/test/python/checkpointing/test_dali_checkpointing.py index 925236fb828..89a27b7f101 100644 --- a/dali/test/python/checkpointing/test_dali_checkpointing.py +++ b/dali/test/python/checkpointing/test_dali_checkpointing.py @@ -27,7 +27,7 @@ get_dali_extra_path, module_functions, ) -from nose_utils import assert_warns, assert_raises +from nose_utils import assert_warns, assert_raises, attr from nose2.tools import params, cartesian_params from dataclasses import dataclass from nvidia.dali import tfrecord as tfrec @@ -35,7 +35,6 @@ from nvidia.dali.auto_aug import rand_augment as ra from nvidia.dali.auto_aug import trivial_augment as ta from reader.test_numpy import is_gds_supported -from nose.plugins.attrib import attr reader_signed_off = create_sign_off_decorator() diff --git a/dali/test/python/checkpointing/test_dali_checkpointing_fw_iterators.py b/dali/test/python/checkpointing/test_dali_checkpointing_fw_iterators.py index c0f1e526e03..941608c2b3d 100644 --- a/dali/test/python/checkpointing/test_dali_checkpointing_fw_iterators.py +++ b/dali/test/python/checkpointing/test_dali_checkpointing_fw_iterators.py @@ -24,13 +24,12 @@ make_external_source_test_pipeline_factory, images_dir, ) -from nose_utils import assert_raises +from nose_utils import assert_raises, SkipTest import nvidia.dali.fn as fn from nvidia.dali.pipeline import pipeline_def from nose2.tools import params, cartesian_params import numpy as np from nvidia.dali.plugin.base_iterator import LastBatchPolicy -from nose import SkipTest class FwTestBase: diff --git a/dali/test/python/checkpointing/test_dali_stateless_operators.py b/dali/test/python/checkpointing/test_dali_stateless_operators.py index cb3cd6031d7..dccba51af8c 100644 --- a/dali/test/python/checkpointing/test_dali_stateless_operators.py +++ b/dali/test/python/checkpointing/test_dali_stateless_operators.py @@ -27,8 +27,7 @@ restrict_platform, ) from nose2.tools import params, cartesian_params -from nose_utils import assert_raises, SkipTest -from nose.plugins.attrib import attr +from nose_utils import assert_raises, SkipTest, attr # Test configuration batch_size = 8 diff --git a/dali/test/python/decoder/test_image.py b/dali/test/python/decoder/test_image.py index ade63744acf..96f5dd20c8b 100644 --- a/dali/test/python/decoder/test_image.py +++ b/dali/test/python/decoder/test_image.py @@ -23,7 +23,7 @@ from nvidia.dali import pipeline_def from nose2.tools import params -from nose_utils import assert_raises +from nose_utils import assert_raises, SkipTest from test_utils import check_output_pattern from test_utils import compare_pipelines from test_utils import get_dali_extra_path @@ -279,9 +279,8 @@ def check_fancy_upsampling_body(batch_size, img_type, device): @params(1, 8) def test_fancy_upsampling(batch_size): if nvidia.dali.backend.GetNvjpegVersion() < 12001: - from nose import SkipTest - raise SkipTest("nvJPEG doesn't support fancy upsampling in this version") + data_path = os.path.join(test_data_root, good_path, "jpeg") compare_pipelines( decoder_pipe( diff --git a/dali/test/python/decoder/test_imgcodec.py b/dali/test/python/decoder/test_imgcodec.py index c621adb3e32..54a6a1fad77 100644 --- a/dali/test/python/decoder/test_imgcodec.py +++ b/dali/test/python/decoder/test_imgcodec.py @@ -22,14 +22,13 @@ import random from nvidia.dali import pipeline_def -from nose_utils import assert_raises +from nose_utils import assert_raises, SkipTest from test_utils import compare_pipelines from test_utils import get_dali_extra_path from test_utils import to_array from test_utils import get_arch from test_utils import dump_as_core_artifacts from nose2.tools import params -from nose import SkipTest def get_img_files(data_path, subdir="*", ext=None): @@ -280,9 +279,8 @@ def check_fancy_upsampling_body(batch_size, img_type, device): @params(1, 8) def test_fancy_upsampling(batch_size): if nvidia.dali.backend.GetNvjpegVersion() < 12001: - from nose import SkipTest - raise SkipTest("nvJPEG doesn't support fancy upsampling in this version") + data_path = os.path.join(test_data_root, good_path, "jpeg") compare_pipelines( decoder_pipe( diff --git a/dali/test/python/decoder/test_jpeg_scan_limit.py b/dali/test/python/decoder/test_jpeg_scan_limit.py index 2776a18515f..eb4b2949f05 100644 --- a/dali/test/python/decoder/test_jpeg_scan_limit.py +++ b/dali/test/python/decoder/test_jpeg_scan_limit.py @@ -18,8 +18,7 @@ import unittest from nvidia.dali import pipeline_def -from nose_utils import assert_raises -from nose.plugins.attrib import attr +from nose_utils import assert_raises, attr from nose2.tools import cartesian_params diff --git a/dali/test/python/decoder/test_video.py b/dali/test/python/decoder/test_video.py index b82b78fe47f..d12bd740429 100644 --- a/dali/test/python/decoder/test_video.py +++ b/dali/test/python/decoder/test_video.py @@ -23,9 +23,7 @@ from test_utils import get_dali_extra_path, is_mulit_gpu, skip_if_m60 from nvidia.dali.backend import TensorListGPU from nose2.tools import params -from nose import SkipTest -from nose.plugins.attrib import attr -from nose_utils import assert_raises +from nose_utils import SkipTest, attr, assert_raises filenames = glob.glob(f"{get_dali_extra_path()}/db/video/[cv]fr/*.mp4") diff --git a/dali/test/python/dlpack/test_torch.py b/dali/test/python/dlpack/test_torch.py index 076b6f38e8b..ec354fd9a1d 100644 --- a/dali/test/python/dlpack/test_torch.py +++ b/dali/test/python/dlpack/test_torch.py @@ -2,7 +2,7 @@ import nvidia.dali.fn as fn import torch import numpy as np -from nose.plugins.attrib import attr +from nose_utils import attr @dali.pipeline_def(batch_size=4, num_threads=1, device_id=0, prefetch_queue_depth=2) @@ -16,7 +16,6 @@ def _test_pipe(): @attr("pytorch") def test_dlpack_is_zero_copy(): - print("Testing dlpack") # get a DALI pipeline that produces batches of very large tensors pipe = _test_pipe(batch_size=1, experimental_exec_dynamic=True) pipe.build() @@ -34,7 +33,6 @@ def test_dlpack_is_zero_copy(): @attr("pytorch") def test_dlpack_no_corruption(): - print("Testing dlpack") # get a DALI pipeline that produces batches of very large tensors pipe = _test_pipe(experimental_exec_dynamic=True) pipe.build() diff --git a/dali/test/python/dlpack/test_torch_perf.py b/dali/test/python/dlpack/test_torch_perf.py index eb0816b30f3..7acf567eca0 100644 --- a/dali/test/python/dlpack/test_torch_perf.py +++ b/dali/test/python/dlpack/test_torch_perf.py @@ -3,7 +3,7 @@ import torch import numpy as np import time -from nose.plugins.attrib import attr +from nose_utils import attr @dali.pipeline_def(batch_size=32, num_threads=8, device_id=0) diff --git a/dali/test/python/nose_utils.py b/dali/test/python/nose_utils.py index 3cbb1574153..d342c50fbef 100644 --- a/dali/test/python/nose_utils.py +++ b/dali/test/python/nose_utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -101,6 +101,8 @@ def release_lock(): import nose.suite import nose.plugins.attrib from nose import SkipTest, with_setup # noqa: F401 +from nose.plugins.attrib import attr # noqa: F401 +from nose.tools import nottest # noqa: F401 if sys.version_info >= (3, 10) and not hasattr(collections, "Callable"): nose.case.collections = collections.abc diff --git a/dali/test/python/operator_1/test_arithmetic_ops.py b/dali/test/python/operator_1/test_arithmetic_ops.py index 57373eaff98..8f7eb46093d 100644 --- a/dali/test/python/operator_1/test_arithmetic_ops.py +++ b/dali/test/python/operator_1/test_arithmetic_ops.py @@ -19,12 +19,11 @@ import nvidia.dali.math as math from nvidia.dali.tensors import TensorListGPU import numpy as np -from nose.plugins.attrib import attr +from nose_utils import attr, raises, assert_raises, assert_equals from nose2.tools import params import itertools from test_utils import np_type_to_dali -from nose_utils import raises, assert_raises, assert_equals def list_product(*args): diff --git a/dali/test/python/operator_1/test_cast.py b/dali/test/python/operator_1/test_cast.py index ad287b73dae..00a392ef1c1 100644 --- a/dali/test/python/operator_1/test_cast.py +++ b/dali/test/python/operator_1/test_cast.py @@ -15,7 +15,7 @@ import numpy as np import nvidia.dali.fn as fn import nvidia.dali.types as types -from nose.tools import nottest +from nose_utils import nottest from nvidia.dali import pipeline_def from test_utils import np_type_to_dali import itertools diff --git a/dali/test/python/operator_1/test_crop_mirror_normalize.py b/dali/test/python/operator_1/test_crop_mirror_normalize.py index 022e1f50dd2..a1de4e39207 100644 --- a/dali/test/python/operator_1/test_crop_mirror_normalize.py +++ b/dali/test/python/operator_1/test_crop_mirror_normalize.py @@ -23,8 +23,7 @@ from nvidia.dali.pipeline import Pipeline from nose2.tools import params -from nose_utils import assert_raises -from nose_utils import raises +from nose_utils import raises, assert_raises from test_slice import check_slice_output, abs_slice_start_and_end from test_utils import RandomDataIterator from test_utils import as_array diff --git a/dali/test/python/operator_1/test_gaussian_blur.py b/dali/test/python/operator_1/test_gaussian_blur.py index ebd2b365da8..c4b570ae6c8 100644 --- a/dali/test/python/operator_1/test_gaussian_blur.py +++ b/dali/test/python/operator_1/test_gaussian_blur.py @@ -21,8 +21,7 @@ import cv2 from scipy.ndimage import convolve1d import os -from nose_utils import assert_raises, raises -from nose.plugins.attrib import attr +from nose_utils import assert_raises, raises, attr from sequences_test_utils import video_suite_helper, ArgCb from test_utils import ( diff --git a/dali/test/python/operator_1/test_laplacian.py b/dali/test/python/operator_1/test_laplacian.py index 81677090254..30990706f7a 100644 --- a/dali/test/python/operator_1/test_laplacian.py +++ b/dali/test/python/operator_1/test_laplacian.py @@ -20,8 +20,7 @@ import cv2 from scipy.ndimage import convolve1d, filters as sp_filters import os -from nose_utils import assert_raises -from nose.plugins.attrib import attr +from nose_utils import assert_raises, attr from sequences_test_utils import video_suite_helper, ArgCb from test_utils import get_dali_extra_path, check_batch, RandomlyShapedDataIterator diff --git a/dali/test/python/operator_1/test_numba_func.py b/dali/test/python/operator_1/test_numba_func.py index 5d127a68ed8..672ebe825f3 100644 --- a/dali/test/python/operator_1/test_numba_func.py +++ b/dali/test/python/operator_1/test_numba_func.py @@ -19,7 +19,7 @@ import nvidia.dali as dali import nvidia.dali.fn as fn import nvidia.dali.types as dali_types -from nose_utils import with_setup +from nose_utils import with_setup, attr from test_utils import ( get_dali_extra_path, to_array, @@ -28,7 +28,6 @@ ) from nvidia.dali.plugin.numba.fn.experimental import numba_function from numba import cuda -from nose.plugins.attrib import attr test_data_root = get_dali_extra_path() lmdb_folder = os.path.join(test_data_root, "db", "lmdb") diff --git a/dali/test/python/operator_2/test_filter.py b/dali/test/python/operator_2/test_filter.py index 07a2316fd7f..4a2997fcf4a 100644 --- a/dali/test/python/operator_2/test_filter.py +++ b/dali/test/python/operator_2/test_filter.py @@ -20,7 +20,7 @@ from nvidia.dali import pipeline_def, fn, types from test_utils import get_dali_extra_path, np_type_to_dali, check_batch from nose2.tools import params -from nose.plugins.attrib import attr +from nose_utils import attr from filter_test_utils import filter_baseline, filter_baseline_layout data_root = get_dali_extra_path() diff --git a/dali/test/python/operator_2/test_random_object_bbox.py b/dali/test/python/operator_2/test_random_object_bbox.py index 41d6e9dd29f..bdf7e10ac86 100644 --- a/dali/test/python/operator_2/test_random_object_bbox.py +++ b/dali/test/python/operator_2/test_random_object_bbox.py @@ -14,7 +14,7 @@ # nose_utils goes first to deal with Python 3.10 incompatibility -from nose_utils import assert_raises +from nose_utils import attr, nottest, assert_raises import nvidia.dali as dali import nvidia.dali.fn as fn import nvidia.dali.ops as ops @@ -23,8 +23,6 @@ import scipy.ndimage.measurements import random from test_utils import check_batch, np_type_to_dali -from nose.tools import nottest -from nose.plugins.attrib import attr np.random.seed(1234) diff --git a/dali/test/python/operator_2/test_reduce.py b/dali/test/python/operator_2/test_reduce.py index 9c29b91b213..ae5fe334854 100644 --- a/dali/test/python/operator_2/test_reduce.py +++ b/dali/test/python/operator_2/test_reduce.py @@ -14,12 +14,11 @@ import nvidia.dali.fn as fn from nvidia.dali.pipeline import Pipeline -from nose.tools import nottest +from nose_utils import nottest, assert_raises import numpy as np from test_utils import np_type_to_dali -from nose_utils import assert_raises class Batch: diff --git a/dali/test/python/reader/test_index.py b/dali/test/python/reader/test_index.py index e6fc849744a..78b2bd17397 100644 --- a/dali/test/python/reader/test_index.py +++ b/dali/test/python/reader/test_index.py @@ -21,9 +21,8 @@ import tempfile import numpy as np from test_utils import compare_pipelines, get_dali_extra_path -from nose_utils import assert_raises, raises +from nose_utils import assert_raises, raises, SkipTest from nose2.tools import cartesian_params -from nose import SkipTest def skip_second(src, dst): diff --git a/dali/test/python/reader/test_numpy.py b/dali/test/python/reader/test_numpy.py index a32380c3102..40468ac5397 100644 --- a/dali/test/python/reader/test_numpy.py +++ b/dali/test/python/reader/test_numpy.py @@ -22,8 +22,7 @@ import platform import random import tempfile -from nose_utils import assert_raises -from nose import SkipTest +from nose_utils import assert_raises, SkipTest from nose2.tools import params, cartesian_params from test_utils import compare_pipelines, to_array diff --git a/dali/test/python/reader/test_webdataset_corner.py b/dali/test/python/reader/test_webdataset_corner.py index afeb452ed2d..bc20011859d 100644 --- a/dali/test/python/reader/test_webdataset_corner.py +++ b/dali/test/python/reader/test_webdataset_corner.py @@ -17,10 +17,9 @@ import os import tempfile from glob import glob -from nose_utils import assert_equals +from nose_utils import assert_equals, assert_raises import webdataset_base as base -from nose_utils import assert_raises from test_utils import compare_pipelines, get_dali_extra_path diff --git a/dali/test/python/reader/test_webdataset_requirements.py b/dali/test/python/reader/test_webdataset_requirements.py index 44cdfc86916..09aa47c942a 100644 --- a/dali/test/python/reader/test_webdataset_requirements.py +++ b/dali/test/python/reader/test_webdataset_requirements.py @@ -17,8 +17,7 @@ import math import nvidia.dali as dali from test_utils import compare_pipelines, get_dali_extra_path -from nose_utils import assert_raises -from nose_utils import assert_equals +from nose_utils import assert_raises, assert_equals from webdataset_base import ( generate_temp_extract, generate_temp_index_file, diff --git a/dali/test/python/test_backend_impl.py b/dali/test/python/test_backend_impl.py index 04ec1222507..23a0e83c1dc 100644 --- a/dali/test/python/test_backend_impl.py +++ b/dali/test/python/test_backend_impl.py @@ -22,8 +22,7 @@ from nvidia.dali.backend_impl import types as types_ import nvidia.dali as dali -from nose_utils import assert_raises -from nose import SkipTest +from nose_utils import assert_raises, SkipTest from test_utils import dali_type_to_np, py_buffer_from_address, get_device_memory_info diff --git a/dali/test/python/test_dali_cpu_only.py b/dali/test/python/test_dali_cpu_only.py index 002588b0a2a..fc779655a23 100644 --- a/dali/test/python/test_dali_cpu_only.py +++ b/dali/test/python/test_dali_cpu_only.py @@ -22,13 +22,11 @@ import os import re from collections.abc import Iterable -from nose.plugins.attrib import attr -from nose.tools import nottest +from nose_utils import attr, nottest, assert_raises from nvidia.dali.pipeline import Pipeline, pipeline_def from nvidia.dali.pipeline.experimental import pipeline_def as experimental_pipeline_def from nvidia.dali.plugin.numba.fn.experimental import numba_function -from nose_utils import assert_raises from segmentation_test_utils import make_batch_select_masks from test_dali_cpu_only_utils import ( pipeline_arithm_ops_cpu, diff --git a/dali/test/python/test_dali_tf_dataset_eager.py b/dali/test/python/test_dali_tf_dataset_eager.py index ed59e229707..ee3b15ec716 100644 --- a/dali/test/python/test_dali_tf_dataset_eager.py +++ b/dali/test/python/test_dali_tf_dataset_eager.py @@ -18,7 +18,7 @@ import nvidia.dali.plugin.tf as dali_tf from nvidia.dali.plugin.tf.experimental import Input from nvidia.dali import fn -from nose_utils import with_setup +from nose_utils import with_setup, raises from test_dali_tf_dataset_pipelines import ( FixedSampleIterator, RandomSampleIterator, @@ -46,7 +46,6 @@ skip_for_incompatible_tf, skip_inputs_for_incompatible_tf, ) -from nose_utils import raises import random as random import itertools diff --git a/dali/test/python/test_dali_tf_dataset_graph.py b/dali/test/python/test_dali_tf_dataset_graph.py index 2ceb89921fb..32702536a8f 100644 --- a/dali/test/python/test_dali_tf_dataset_graph.py +++ b/dali/test/python/test_dali_tf_dataset_graph.py @@ -16,9 +16,7 @@ import numpy as np import random as random import tensorflow as tf -from nose_utils import with_setup - -from nose_utils import raises +from nose_utils import with_setup, raises from test_dali_tf_dataset_pipelines import ( FixedSampleIterator, external_source_tester, diff --git a/dali/test/python/test_dali_tf_dataset_mnist.py b/dali/test/python/test_dali_tf_dataset_mnist.py index 55731421955..556bb4fafde 100644 --- a/dali/test/python/test_dali_tf_dataset_mnist.py +++ b/dali/test/python/test_dali_tf_dataset_mnist.py @@ -22,7 +22,7 @@ import tensorflow as tf import tensorflow.compat.v1 as tf_v1 from packaging.version import Version -from nose import SkipTest +from nose_utils import SkipTest TARGET = 0.8 diff --git a/dali/test/python/test_dali_tf_dataset_mnist_eager.py b/dali/test/python/test_dali_tf_dataset_mnist_eager.py index dcc93be60d0..dd742c314de 100644 --- a/dali/test/python/test_dali_tf_dataset_mnist_eager.py +++ b/dali/test/python/test_dali_tf_dataset_mnist_eager.py @@ -13,12 +13,10 @@ # limitations under the License. import tensorflow as tf -from nose_utils import with_setup +from nose_utils import with_setup, raises, SkipTest import test_dali_tf_dataset_mnist as mnist from test_utils_tensorflow import skip_for_incompatible_tf, available_gpus -from nose_utils import raises -from nose import SkipTest from packaging.version import Version tf.compat.v1.enable_eager_execution() diff --git a/dali/test/python/test_dali_tf_dataset_pipelines.py b/dali/test/python/test_dali_tf_dataset_pipelines.py index 677930925db..9f3f549cbf0 100644 --- a/dali/test/python/test_dali_tf_dataset_pipelines.py +++ b/dali/test/python/test_dali_tf_dataset_pipelines.py @@ -17,7 +17,7 @@ import nvidia.dali.fn as fn import nvidia.dali.plugin.tf as dali_tf import tensorflow as tf -from nose.tools import nottest +from nose_utils import nottest from nvidia.dali import pipeline_def from test_utils import RandomlyShapedDataIterator diff --git a/dali/test/python/test_dali_variable_batch_size.py b/dali/test/python/test_dali_variable_batch_size.py index cca8aefe868..91299f361e8 100644 --- a/dali/test/python/test_dali_variable_batch_size.py +++ b/dali/test/python/test_dali_variable_batch_size.py @@ -21,9 +21,7 @@ import random import re from functools import partial -from nose_utils import SkipTest -from nose.plugins.attrib import attr -from nose.tools import nottest +from nose_utils import SkipTest, attr, nottest from nvidia.dali.pipeline import Pipeline, pipeline_def from nvidia.dali.pipeline.experimental import pipeline_def as experimental_pipeline_def from nvidia.dali.plugin.numba.fn.experimental import numba_function diff --git a/dali/test/python/test_external_source_cupy.py b/dali/test/python/test_external_source_cupy.py index d2176144090..50276fe79ae 100644 --- a/dali/test/python/test_external_source_cupy.py +++ b/dali/test/python/test_external_source_cupy.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from nose.plugins.attrib import attr +from nose_utils import attr # it is enough to just import all functions from test_internals_operator_external_source # nose will query for the methods available and will run them diff --git a/dali/test/python/test_external_source_impl_utils.py b/dali/test/python/test_external_source_impl_utils.py index 5ccb5e64e7b..28eca9b20c1 100644 --- a/dali/test/python/test_external_source_impl_utils.py +++ b/dali/test/python/test_external_source_impl_utils.py @@ -15,8 +15,7 @@ from nvidia.dali._utils import external_source_impl from nvidia.dali import tensors, pipeline_def import nvidia.dali.fn as fn -from nose_utils import raises, assert_equals -from nose.plugins.attrib import attr +from nose_utils import raises, assert_equals, attr import numpy as np diff --git a/dali/test/python/test_external_source_pytorch_gpu.py b/dali/test/python/test_external_source_pytorch_gpu.py index ec426157135..9cea9006529 100644 --- a/dali/test/python/test_external_source_pytorch_gpu.py +++ b/dali/test/python/test_external_source_pytorch_gpu.py @@ -18,7 +18,7 @@ # so it is better to store everything in one file and just call `use_cupy` # to switch between the default numpy and cupy -from nose.plugins.attrib import attr +from nose_utils import attr from nvidia.dali.pipeline import Pipeline import nvidia.dali.fn as fn from test_utils import check_output diff --git a/dali/test/python/test_functional_api.py b/dali/test/python/test_functional_api.py index 182ae09c84d..73f5c35adaa 100644 --- a/dali/test/python/test_functional_api.py +++ b/dali/test/python/test_functional_api.py @@ -17,10 +17,9 @@ from nvidia.dali.pipeline import Pipeline import nvidia.dali.types as types import numpy as np -from nose_utils import assert_raises +from nose_utils import assert_raises, attr import sys import inspect -from nose.plugins.attrib import attr import nose diff --git a/dali/test/python/test_fw_iterators.py b/dali/test/python/test_fw_iterators.py index 73960ebbb78..d3a249288f8 100644 --- a/dali/test/python/test_fw_iterators.py +++ b/dali/test/python/test_fw_iterators.py @@ -20,10 +20,8 @@ import numpy as np import os from test_utils import get_dali_extra_path -from nose.tools import nottest -from nose_utils import raises, assert_raises +from nose_utils import raises, assert_raises, nottest, attr from nose2.tools import params -from nose.plugins.attrib import attr from nvidia.dali.plugin.base_iterator import LastBatchPolicy as LastBatchPolicy import random diff --git a/dali/test/python/test_optical_flow.py b/dali/test/python/test_optical_flow.py index 7459a97d6b7..61b57da3aa2 100644 --- a/dali/test/python/test_optical_flow.py +++ b/dali/test/python/test_optical_flow.py @@ -20,8 +20,7 @@ from nvidia.dali.pipeline import pipeline_def from nvidia.dali import fn, types from test_utils import get_dali_extra_path, get_arch -from nose_utils import raises, assert_raises -from nose import SkipTest +from nose_utils import raises, assert_raises, SkipTest test_data_root = get_dali_extra_path() images_dir = os.path.join(test_data_root, "db", "imgproc") diff --git a/dali/test/python/test_pipeline.py b/dali/test/python/test_pipeline.py index a88473a1d9b..51e2c57bace 100644 --- a/dali/test/python/test_pipeline.py +++ b/dali/test/python/test_pipeline.py @@ -36,9 +36,7 @@ get_dali_extra_path, RandomDataIterator, ) -from nose_utils import raises -from nose_utils import assert_raises -from nose.plugins.skip import SkipTest +from nose_utils import raises, assert_raises, SkipTest test_data_root = get_dali_extra_path() caffe_db_folder = os.path.join(test_data_root, "db", "lmdb") diff --git a/dali/test/python/test_pipeline_debug.py b/dali/test/python/test_pipeline_debug.py index 31dbef3a9c5..b3dee99d910 100644 --- a/dali/test/python/test_pipeline_debug.py +++ b/dali/test/python/test_pipeline_debug.py @@ -14,15 +14,12 @@ import numpy as np import os -from nose.plugins.attrib import attr - from nvidia.dali import fn from nvidia.dali import tensors from nvidia.dali import types from nvidia.dali.pipeline.experimental import pipeline_def -from nose_utils import raises +from nose_utils import attr, raises, assert_raises from test_utils import compare_pipelines, get_dali_extra_path -from nose_utils import assert_raises from conditionals.test_pipeline_conditionals import ( pred_gens, diff --git a/dali/test/python/test_pipeline_decorator.py b/dali/test/python/test_pipeline_decorator.py index e91b983be5f..e709bf15076 100644 --- a/dali/test/python/test_pipeline_decorator.py +++ b/dali/test/python/test_pipeline_decorator.py @@ -14,8 +14,7 @@ from nvidia.dali import Pipeline, pipeline_def from nvidia.dali.pipeline import do_not_convert -from nose.tools import nottest -from nose_utils import raises, assert_raises +from nose_utils import raises, assert_raises, nottest import nvidia.dali.fn as fn from test_utils import get_dali_extra_path, compare_pipelines import os diff --git a/dali/test/python/test_pipeline_inputs.py b/dali/test/python/test_pipeline_inputs.py index bc788e7ad47..1a505b7de9a 100644 --- a/dali/test/python/test_pipeline_inputs.py +++ b/dali/test/python/test_pipeline_inputs.py @@ -15,13 +15,12 @@ import numpy as np import nvidia.dali.fn as fn -from nose.plugins.attrib import attr +from nose_utils import attr, raises from nose2.tools import params from numpy.random import default_rng from nvidia.dali import pipeline_def from nvidia.dali.tensors import TensorCPU, TensorGPU -from nose_utils import raises from test_utils import to_array max_batch_size = 256 diff --git a/dali/test/python/test_torch_pipeline_rnnt.py b/dali/test/python/test_torch_pipeline_rnnt.py index 7afdcca362d..d294fb7fefb 100644 --- a/dali/test/python/test_torch_pipeline_rnnt.py +++ b/dali/test/python/test_torch_pipeline_rnnt.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import nose_utils # noqa:F401 - for Python 3.10 +from nose_utils import nottest import nvidia.dali.fn as fn from nvidia.dali import pipeline_def import nvidia.dali.types as types @@ -23,7 +23,6 @@ import math import random import os -from nose.tools import nottest # Filtering librispeech samples audio_files = get_files("db/audio/wav", "wav") diff --git a/dali/test/python/test_utils_tensorflow.py b/dali/test/python/test_utils_tensorflow.py index de3777f3e3d..7420f5c2b5e 100644 --- a/dali/test/python/test_utils_tensorflow.py +++ b/dali/test/python/test_utils_tensorflow.py @@ -20,7 +20,7 @@ import os import tensorflow as tf from contextlib import contextmanager -from nose import SkipTest +from nose_utils import SkipTest from nvidia.dali.pipeline import Pipeline from tensorflow.python.client import device_lib diff --git a/dali/test/python/type_annotations/test_typing_pipelines.py b/dali/test/python/type_annotations/test_typing_pipelines.py index bd9e42a0400..e258d500b3b 100644 --- a/dali/test/python/type_annotations/test_typing_pipelines.py +++ b/dali/test/python/type_annotations/test_typing_pipelines.py @@ -24,7 +24,7 @@ from nvidia.dali.pipeline import pipeline_def, Pipeline from test_utils import get_dali_extra_path, check_numba_compatibility_cpu -from nose.plugins.attrib import attr # type: ignore +from nose_utils import attr # type: ignore _test_root = Path(get_dali_extra_path())