From 30aa240ab1ab9fb7afbd2fc04b5e2a8d1c0f51bd Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:48:30 +0000 Subject: [PATCH] Run unittest on non-editable installation --- .circleci/unittest/linux/scripts/install.sh | 2 +- .circleci/unittest/linux/scripts/run_test.sh | 11 +++++- .circleci/unittest/windows/scripts/install.sh | 2 +- .../unittest/windows/scripts/run_test.sh | 4 +- test/README.md | 36 +++++++++--------- test/{ => torchaudio_unittest}/__init__.py | 0 .../tt/clips/common_voice_tt_00000000.wav | Bin .../cv-corpus-4-2019-12-10/tt/train.tsv | 0 .../assets/VCTK-Corpus/txt/p224/p224_002.txt | 0 .../VCTK-Corpus/wav48/p224/p224_002.wav | Bin .../assets/io/96k_0_1ch.opus | Bin .../assets/io/96k_0_2ch.opus | Bin .../assets/io/96k_10_1ch.opus | Bin .../assets/io/96k_10_2ch.opus | Bin .../assets/io/96k_5_1ch.opus | Bin .../assets/io/96k_5_2ch.opus | Bin .../assets/io/generate_opus.py | 0 .../assets/kaldi/resample-16000-1000.ark | Bin .../assets/kaldi/resample-16000-10000.ark | Bin .../assets/kaldi/resample-16000-11000.ark | Bin .../assets/kaldi/resample-16000-12000.ark | Bin .../assets/kaldi/resample-16000-13000.ark | Bin .../assets/kaldi/resample-16000-14000.ark | Bin .../assets/kaldi/resample-16000-15000.ark | Bin .../assets/kaldi/resample-16000-16000.ark | Bin .../assets/kaldi/resample-16000-17000.ark | Bin .../assets/kaldi/resample-16000-18000.ark | Bin .../assets/kaldi/resample-16000-19000.ark | Bin .../assets/kaldi/resample-16000-2000.ark | Bin .../assets/kaldi/resample-16000-20000.ark | Bin .../assets/kaldi/resample-16000-21000.ark | Bin .../assets/kaldi/resample-16000-22000.ark | Bin .../assets/kaldi/resample-16000-23000.ark | Bin .../assets/kaldi/resample-16000-24000.ark | Bin .../assets/kaldi/resample-16000-25000.ark | Bin .../assets/kaldi/resample-16000-26000.ark | Bin .../assets/kaldi/resample-16000-27000.ark | Bin .../assets/kaldi/resample-16000-28000.ark | Bin .../assets/kaldi/resample-16000-29000.ark | Bin .../assets/kaldi/resample-16000-3000.ark | Bin .../assets/kaldi/resample-16000-30000.ark | Bin .../assets/kaldi/resample-16000-31000.ark | Bin .../assets/kaldi/resample-16000-32000.ark | Bin .../assets/kaldi/resample-16000-4000.ark | Bin .../assets/kaldi/resample-16000-5000.ark | Bin .../assets/kaldi/resample-16000-6000.ark | Bin .../assets/kaldi/resample-16000-7000.ark | Bin .../assets/kaldi/resample-16000-8000.ark | Bin .../assets/kaldi/resample-16000-9000.ark | Bin .../assets/kaldi_file.wav | Bin .../assets/kaldi_file_8000.wav | Bin .../assets/kaldi_test_fbank_args.json | 0 .../assets/kaldi_test_mfcc_args.json | 0 .../assets/kaldi_test_spectrogram_args.json | 0 test/{ => torchaudio_unittest}/assets/mat.ark | Bin .../assets/sinewave.wav | Bin .../assets/sox_effect_test_args.json | 0 .../assets/sox_effect_test_fir_coeffs.txt | 0 .../steam-train-whistle-daniel_simon.mp3 | Bin .../steam-train-whistle-daniel_simon.wav | Bin .../assets/vad-go-mono-32000.wav | Bin .../assets/vad-go-stereo-44100.wav | Bin .../assets/vec_flt.ark | Bin .../assets/vec_int.ark | Bin .../backend_test.py} | 2 +- .../batch_consistency_test.py} | 2 +- .../common_utils/__init__.py | 0 .../common_utils/backend_utils.py | 0 .../common_utils/case_utils.py | 0 .../common_utils/data_utils.py | 0 .../common_utils/parameterized_utils.py | 0 .../common_utils/sox_utils.py | 0 .../common_utils/wav_utils.py | 0 .../compliance/__init__.py | 0 .../compliance/generate_fbank_data.py | 0 .../compliance/generate_test_stft_data.py | 0 .../compliance/utils.py | 0 .../compliance_kaldi_test.py} | 2 +- .../dataloader_test.py} | 2 +- .../datasets/__init__.py | 0 .../datasets/cmuarctic_test.py | 2 +- .../datasets/commonvoice_test.py | 2 +- .../datasets/datasets_test.py | 2 +- .../datasets/gtzan_test.py | 2 +- .../datasets/librispeech_test.py | 2 +- .../datasets/libritts_test.py | 2 +- .../datasets/ljspeech_test.py | 2 +- .../datasets/speechcommands_test.py | 2 +- .../datasets/utils_test.py | 2 +- .../datasets/yesno_test.py | 2 +- .../functional}/__init__.py | 0 .../functional}/functional_cpu_test.py | 2 +- .../functional}/functional_cuda_test.py | 2 +- .../functional}/functional_impl.py | 2 +- .../io_test.py} | 2 +- .../kaldi_compatibility_cpu_test.py | 2 +- .../kaldi_compatibility_cuda_test.py | 2 +- .../kaldi_compatibility_impl.py | 2 +- .../kaldi_io_test.py} | 2 +- .../librosa_compatibility_test.py} | 2 +- .../models_test.py} | 2 +- .../sox_compatibility_test.py} | 2 +- .../sox_effect}/__init__.py | 0 .../sox_effect/common.py | 2 +- .../sox_effect/dataset_test.py} | 2 +- .../sox_effect/smoke_test.py | 2 +- .../sox_effect/sox_effect_test.py} | 2 +- .../sox_effect/sox_effects_chain_test.py | 0 .../sox_effect/torchscript_test.py} | 2 +- .../sox_io_backend}/__init__.py | 0 .../sox_io_backend/common.py | 0 .../sox_io_backend/info_test.py} | 2 +- .../sox_io_backend/load_test.py} | 2 +- .../sox_io_backend/roundtrip_test.py} | 2 +- .../sox_io_backend/save_test.py} | 2 +- .../sox_io_backend/smoke_test.py | 2 +- .../sox_io_backend/torchscript_test.py} | 2 +- .../torchscript_consistency_cpu_test.py | 2 +- .../torchscript_consistency_cuda_test.py | 2 +- .../torchscript_consistency_impl.py | 2 +- .../transforms_test.py} | 2 +- test/torchaudio_unittest/utils/__init__.py | 0 .../utils/sox_utils_test.py} | 2 +- 123 files changed, 72 insertions(+), 65 deletions(-) rename test/{ => torchaudio_unittest}/__init__.py (100%) rename test/{ => torchaudio_unittest}/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/clips/common_voice_tt_00000000.wav (100%) rename test/{ => torchaudio_unittest}/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/train.tsv (100%) rename test/{ => torchaudio_unittest}/assets/VCTK-Corpus/txt/p224/p224_002.txt (100%) rename test/{ => torchaudio_unittest}/assets/VCTK-Corpus/wav48/p224/p224_002.wav (100%) rename test/{ => torchaudio_unittest}/assets/io/96k_0_1ch.opus (100%) rename test/{ => torchaudio_unittest}/assets/io/96k_0_2ch.opus (100%) rename test/{ => torchaudio_unittest}/assets/io/96k_10_1ch.opus (100%) rename test/{ => torchaudio_unittest}/assets/io/96k_10_2ch.opus (100%) rename test/{ => torchaudio_unittest}/assets/io/96k_5_1ch.opus (100%) rename test/{ => torchaudio_unittest}/assets/io/96k_5_2ch.opus (100%) rename test/{ => torchaudio_unittest}/assets/io/generate_opus.py (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-1000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-10000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-11000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-12000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-13000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-14000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-15000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-16000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-17000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-18000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-19000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-2000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-20000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-21000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-22000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-23000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-24000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-25000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-26000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-27000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-28000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-29000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-3000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-30000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-31000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-32000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-4000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-5000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-6000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-7000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-8000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi/resample-16000-9000.ark (100%) rename test/{ => torchaudio_unittest}/assets/kaldi_file.wav (100%) rename test/{ => torchaudio_unittest}/assets/kaldi_file_8000.wav (100%) rename test/{ => torchaudio_unittest}/assets/kaldi_test_fbank_args.json (100%) rename test/{ => torchaudio_unittest}/assets/kaldi_test_mfcc_args.json (100%) rename test/{ => torchaudio_unittest}/assets/kaldi_test_spectrogram_args.json (100%) rename test/{ => torchaudio_unittest}/assets/mat.ark (100%) rename test/{ => torchaudio_unittest}/assets/sinewave.wav (100%) rename test/{ => torchaudio_unittest}/assets/sox_effect_test_args.json (100%) rename test/{ => torchaudio_unittest}/assets/sox_effect_test_fir_coeffs.txt (100%) rename test/{ => torchaudio_unittest}/assets/steam-train-whistle-daniel_simon.mp3 (100%) rename test/{ => torchaudio_unittest}/assets/steam-train-whistle-daniel_simon.wav (100%) rename test/{ => torchaudio_unittest}/assets/vad-go-mono-32000.wav (100%) rename test/{ => torchaudio_unittest}/assets/vad-go-stereo-44100.wav (100%) rename test/{ => torchaudio_unittest}/assets/vec_flt.ark (100%) rename test/{ => torchaudio_unittest}/assets/vec_int.ark (100%) rename test/{test_backend.py => torchaudio_unittest/backend_test.py} (96%) rename test/{test_batch_consistency.py => torchaudio_unittest/batch_consistency_test.py} (99%) rename test/{ => torchaudio_unittest}/common_utils/__init__.py (100%) rename test/{ => torchaudio_unittest}/common_utils/backend_utils.py (100%) rename test/{ => torchaudio_unittest}/common_utils/case_utils.py (100%) rename test/{ => torchaudio_unittest}/common_utils/data_utils.py (100%) rename test/{ => torchaudio_unittest}/common_utils/parameterized_utils.py (100%) rename test/{ => torchaudio_unittest}/common_utils/sox_utils.py (100%) rename test/{ => torchaudio_unittest}/common_utils/wav_utils.py (100%) rename test/{ => torchaudio_unittest}/compliance/__init__.py (100%) rename test/{ => torchaudio_unittest}/compliance/generate_fbank_data.py (100%) rename test/{ => torchaudio_unittest}/compliance/generate_test_stft_data.py (100%) rename test/{ => torchaudio_unittest}/compliance/utils.py (100%) rename test/{test_compliance_kaldi.py => torchaudio_unittest/compliance_kaldi_test.py} (99%) rename test/{test_dataloader.py => torchaudio_unittest/dataloader_test.py} (96%) rename test/{ => torchaudio_unittest}/datasets/__init__.py (100%) rename test/{ => torchaudio_unittest}/datasets/cmuarctic_test.py (97%) rename test/{ => torchaudio_unittest}/datasets/commonvoice_test.py (98%) rename test/{ => torchaudio_unittest}/datasets/datasets_test.py (88%) rename test/{ => torchaudio_unittest}/datasets/gtzan_test.py (98%) rename test/{ => torchaudio_unittest}/datasets/librispeech_test.py (98%) rename test/{ => torchaudio_unittest}/datasets/libritts_test.py (98%) rename test/{ => torchaudio_unittest}/datasets/ljspeech_test.py (98%) rename test/{ => torchaudio_unittest}/datasets/speechcommands_test.py (98%) rename test/{ => torchaudio_unittest}/datasets/utils_test.py (97%) rename test/{ => torchaudio_unittest}/datasets/yesno_test.py (96%) rename test/{sox_effect => torchaudio_unittest/functional}/__init__.py (100%) rename test/{ => torchaudio_unittest/functional}/functional_cpu_test.py (99%) rename test/{ => torchaudio_unittest/functional}/functional_cuda_test.py (88%) rename test/{ => torchaudio_unittest/functional}/functional_impl.py (96%) rename test/{test_io.py => torchaudio_unittest/io_test.py} (99%) rename test/{ => torchaudio_unittest}/kaldi_compatibility_cpu_test.py (87%) rename test/{ => torchaudio_unittest}/kaldi_compatibility_cuda_test.py (88%) rename test/{ => torchaudio_unittest}/kaldi_compatibility_impl.py (98%) rename test/{test_kaldi_io.py => torchaudio_unittest/kaldi_io_test.py} (96%) rename test/{test_librosa_compatibility.py => torchaudio_unittest/librosa_compatibility_test.py} (99%) rename test/{test_models.py => torchaudio_unittest/models_test.py} (98%) rename test/{test_sox_compatibility.py => torchaudio_unittest/sox_compatibility_test.py} (99%) rename test/{sox_io_backend => torchaudio_unittest/sox_effect}/__init__.py (100%) rename test/{ => torchaudio_unittest}/sox_effect/common.py (92%) rename test/{sox_effect/test_dataset.py => torchaudio_unittest/sox_effect/dataset_test.py} (98%) rename test/{ => torchaudio_unittest}/sox_effect/smoke_test.py (97%) rename test/{sox_effect/test_sox_effect.py => torchaudio_unittest/sox_effect/sox_effect_test.py} (99%) rename test/{ => torchaudio_unittest}/sox_effect/sox_effects_chain_test.py (100%) rename test/{sox_effect/test_torchscript.py => torchaudio_unittest/sox_effect/torchscript_test.py} (98%) rename test/{utils => torchaudio_unittest/sox_io_backend}/__init__.py (100%) rename test/{ => torchaudio_unittest}/sox_io_backend/common.py (100%) rename test/{sox_io_backend/test_info.py => torchaudio_unittest/sox_io_backend/info_test.py} (98%) rename test/{sox_io_backend/test_load.py => torchaudio_unittest/sox_io_backend/load_test.py} (99%) rename test/{sox_io_backend/test_roundtrip.py => torchaudio_unittest/sox_io_backend/roundtrip_test.py} (97%) rename test/{sox_io_backend/test_save.py => torchaudio_unittest/sox_io_backend/save_test.py} (99%) rename test/{ => torchaudio_unittest}/sox_io_backend/smoke_test.py (98%) rename test/{sox_io_backend/test_torchscript.py => torchaudio_unittest/sox_io_backend/torchscript_test.py} (99%) rename test/{ => torchaudio_unittest}/torchscript_consistency_cpu_test.py (93%) rename test/{ => torchaudio_unittest}/torchscript_consistency_cuda_test.py (94%) rename test/{ => torchaudio_unittest}/torchscript_consistency_impl.py (99%) rename test/{test_transforms.py => torchaudio_unittest/transforms_test.py} (99%) create mode 100644 test/torchaudio_unittest/utils/__init__.py rename test/{utils/test_sox_utils.py => torchaudio_unittest/utils/sox_utils_test.py} (97%) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 131c9e43bf..8346e6c825 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -20,4 +20,4 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" conda install -y -c pytorch-nightly pytorch "${cudatoolkit}" printf "* Installing torchaudio\n" -BUILD_SOX=1 python setup.py develop +BUILD_SOX=1 python setup.py install diff --git a/.circleci/unittest/linux/scripts/run_test.sh b/.circleci/unittest/linux/scripts/run_test.sh index 63bd5aa52d..50bcf711d6 100755 --- a/.circleci/unittest/linux/scripts/run_test.sh +++ b/.circleci/unittest/linux/scripts/run_test.sh @@ -15,8 +15,15 @@ python -m torch.utils.collect_env export TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION=1 export PATH="${PWD}/third_party/install/bin/:${PATH}" +declare -a common_args=( + '--cov=torchaudio' + "--junitxml=${PWD}/test-results/junit.xml" + '--durations' '20' +) if [ "${os}" == MacOSX ] ; then - pytest -q -n auto --dist=loadscope --cov=torchaudio --junitxml=test-results/junit.xml --durations 20 test + declare -a args=('-q' '-n' 'auto' '--dist=loadscope') else - pytest -v --cov=torchaudio --junitxml=test-results/junit.xml --durations 20 test + declare -a args=('-v') fi +cd test +pytest "${args[@]}" "${common_args[@]}" torchaudio_unittest diff --git a/.circleci/unittest/windows/scripts/install.sh b/.circleci/unittest/windows/scripts/install.sh index acbd79ae50..2b9c88b4af 100644 --- a/.circleci/unittest/windows/scripts/install.sh +++ b/.circleci/unittest/windows/scripts/install.sh @@ -20,4 +20,4 @@ printf "Installing PyTorch with %s\n" "${cudatoolkit}" conda install -y -c pytorch-nightly pytorch "${cudatoolkit}" printf "* Installing torchaudio\n" -python setup.py develop +python setup.py install diff --git a/.circleci/unittest/windows/scripts/run_test.sh b/.circleci/unittest/windows/scripts/run_test.sh index 252c1e9f46..7fdd1d4c6d 100644 --- a/.circleci/unittest/windows/scripts/run_test.sh +++ b/.circleci/unittest/windows/scripts/run_test.sh @@ -6,5 +6,5 @@ eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" conda activate ./env python -m torch.utils.collect_env -pytest --cov=torchaudio --junitxml=test-results/junit.xml -v --durations 20 test -flake8 torchaudio test +cd test +pytest --cov=torchaudio --junitxml=../test-results/junit.xml -v --durations 20 torchaudio_unittest diff --git a/test/README.md b/test/README.md index 09e7a09fb4..629e5b54be 100644 --- a/test/README.md +++ b/test/README.md @@ -29,39 +29,39 @@ The following is an overview of the tests and related modules for `torchaudio`. ### Purpose specific test suites #### Numerical compatibility agains existing software -- [Librosa compatibility test](./test_librosa_compatibility.py) +- [Librosa compatibility test](./torchaudio_unittest/librosa_compatibility_test.py) Test suite for numerical compatibility against librosa. -- [SoX compatibility test](./test_sox_compatibility.py) +- [SoX compatibility test](./torchaudio_unittest/sox_compatibility_test.py) Test suite for numerical compatibility against SoX. -- [Kaldi compatibility test](./test_kaldi_compatibility.py) +- [Kaldi compatibility test](./torchaudio_unittest/kaldi_compatibility_test.py) Test suite for numerical compatibility against Kaldi. #### Result consistency with PyTorch framework -- [TorchScript consistency test](torchscript_consistency_impl.py) +- [TorchScript consistency test](./torchaudio_unittest/torchscript_consistency_impl.py) Test suite to check 1. if an API is TorchScript-able, and 2. the results from Python and Torchscript match. -- [Batch consistency test](./test_batch_consistency.py) +- [Batch consistency test](./torchaudio_unittest/batch_consistency_test.py) Test suite to check if functionals/Transforms handle single sample input and batch input and return the same result. ### Module specific test suites The following test modules are defined for corresponding `torchaudio` module/functions. -- [`torchaudio.datasets`](./test_datasets) -- `torchaudio.functional` [CPU](./functional_cpu_test.py), [CUDA](./functional_cuda_test.py), [common](./functional_impl.py) -- [`torchaudio.transforms`](./test_transforms.py) -- [`torchaudio.compliance.kaldi`](./test_compliance_kaldi.py) -- [`torchaudio.kaldi_io`](./test_kaldi_io.py) +- [`torchaudio.datasets`](./torchaudio_unittest/datasets) +- [`torchaudio.functional`](./torchaudio_unittest/functional) +- [`torchaudio.transforms`](./torchaudio_unittest/transforms_test.py) +- [`torchaudio.compliance.kaldi`](./torchaudio_unittest/compliance_kaldi_test.py) +- [`torchaudio.kaldi_io`](./torchaudio_unittest/kaldi_io_test.py) - [`torchaudio.sox_effects`](test/sox_effects) -- [`torchaudio.save`, `torchaudio.load`, `torchaudio.info`](test/test_io.py) +- [`torchaudio.save`, `torchaudio.load`, `torchaudio.info`](./torchaudio_unittest/io_test.py) ### Test modules that do not fall into the above categories -- [test_dataloader.py](./test_dataloader.py) +- [test_dataloader.py](./torchaudio_unittest/dataloader_test.py) Simple test for loading data and applying preprocessing. ### Support files -- [assets](./assets): Contain sample audio files. -- [assets/kaldi](./assets/kaldi): Contains Kaldi format matrix files used in [./test_compliance_kaldi.py](./test_compliance_kaldi.py). -- [compliance](./compliance): Scripts used to generate above Kaldi matrix files. +- [assets](./torchaudio_unittest/assets): Contain sample audio files. +- [assets/kaldi](./torchaudio_unittest/assets/kaldi): Contains Kaldi format matrix files used in [./torchaudio_unittest/test_compliance_kaldi.py](./torchaudio_unittest/test_compliance_kaldi.py). +- [compliance](./torchaudio_unittest/compliance): Scripts used to generate above Kaldi matrix files. ### Waveforms for Testing Purposes @@ -116,13 +116,13 @@ Files: The following is the current practice of torchaudio test suite. -1. Unless the tests are related to I/O, use synthetic data. [`common_utils`](./common_utils.py) has some data generator functions. +1. Unless the tests are related to I/O, use synthetic data. [`common_utils`](./torchaudio_unittest/common_utils) has some data generator functions. 1. When you add a new test case, use `common_utils.TorchaudioTestCase` as base class unless you are writing tests that are common to CPU / CUDA. - Set class memeber `dtype`, `device` and `backend` for the desired behavior. - If you do not set `backend` value in your test suite, then I/O functions will be unassigned and attempt to load/save file will fail. - For `backend` value, in addition to available backends, you can also provide the value "default" and backend will be picked automatically based on availability. -1. If you are writing tests that should pass on diffrent dtype/devices, write a common class inheriting `common_utils.TestBaseMixin`, then inherit `common_utils.PytorchTestCase` and define class attributes (`dtype` / `device` / `backend`) there. See [Torchscript consistency test implementation](./torchscript_consistency_impl.py) and test definitions for [CPU](./torchscript_consistency_cpu_test.py) and [CUDA](./torchscript_consistency_cuda_test.py) devices. -1. For numerically comparing Tensors, use `assertEqual` method from `common_utils.PytorchTestCase` class. This method has a better support for a wide variety of Tensor types. +1. If you are writing tests that should pass on diffrent dtype/devices, write a common class inheriting `common_utils.TestBaseMixin`, then inherit `common_utils.PytorchTestCase` and define class attributes (`dtype` / `device` / `backend`) there. See [Torchscript consistency test implementation](./torchaudio_unittest/torchscript_consistency_impl.py) and test definitions for [CPU](./torchaudio_unittest/torchscript_consistency_cpu_test.py) and [CUDA](./torchaudio_unittest/torchscript_consistency_cuda_test.py) devices. +1. For numerically comparing Tensors, use `assertEqual` method from torchaudio_unittest.common_utils.PytorchTestCase` class. This method has a better support for a wide variety of Tensor types. When you add a new feature(functional/transform), consider the following diff --git a/test/__init__.py b/test/torchaudio_unittest/__init__.py similarity index 100% rename from test/__init__.py rename to test/torchaudio_unittest/__init__.py diff --git a/test/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/clips/common_voice_tt_00000000.wav b/test/torchaudio_unittest/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/clips/common_voice_tt_00000000.wav similarity index 100% rename from test/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/clips/common_voice_tt_00000000.wav rename to test/torchaudio_unittest/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/clips/common_voice_tt_00000000.wav diff --git a/test/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/train.tsv b/test/torchaudio_unittest/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/train.tsv similarity index 100% rename from test/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/train.tsv rename to test/torchaudio_unittest/assets/CommonVoice/cv-corpus-4-2019-12-10/tt/train.tsv diff --git a/test/assets/VCTK-Corpus/txt/p224/p224_002.txt b/test/torchaudio_unittest/assets/VCTK-Corpus/txt/p224/p224_002.txt similarity index 100% rename from test/assets/VCTK-Corpus/txt/p224/p224_002.txt rename to test/torchaudio_unittest/assets/VCTK-Corpus/txt/p224/p224_002.txt diff --git a/test/assets/VCTK-Corpus/wav48/p224/p224_002.wav b/test/torchaudio_unittest/assets/VCTK-Corpus/wav48/p224/p224_002.wav similarity index 100% rename from test/assets/VCTK-Corpus/wav48/p224/p224_002.wav rename to test/torchaudio_unittest/assets/VCTK-Corpus/wav48/p224/p224_002.wav diff --git a/test/assets/io/96k_0_1ch.opus b/test/torchaudio_unittest/assets/io/96k_0_1ch.opus similarity index 100% rename from test/assets/io/96k_0_1ch.opus rename to test/torchaudio_unittest/assets/io/96k_0_1ch.opus diff --git a/test/assets/io/96k_0_2ch.opus b/test/torchaudio_unittest/assets/io/96k_0_2ch.opus similarity index 100% rename from test/assets/io/96k_0_2ch.opus rename to test/torchaudio_unittest/assets/io/96k_0_2ch.opus diff --git a/test/assets/io/96k_10_1ch.opus b/test/torchaudio_unittest/assets/io/96k_10_1ch.opus similarity index 100% rename from test/assets/io/96k_10_1ch.opus rename to test/torchaudio_unittest/assets/io/96k_10_1ch.opus diff --git a/test/assets/io/96k_10_2ch.opus b/test/torchaudio_unittest/assets/io/96k_10_2ch.opus similarity index 100% rename from test/assets/io/96k_10_2ch.opus rename to test/torchaudio_unittest/assets/io/96k_10_2ch.opus diff --git a/test/assets/io/96k_5_1ch.opus b/test/torchaudio_unittest/assets/io/96k_5_1ch.opus similarity index 100% rename from test/assets/io/96k_5_1ch.opus rename to test/torchaudio_unittest/assets/io/96k_5_1ch.opus diff --git a/test/assets/io/96k_5_2ch.opus b/test/torchaudio_unittest/assets/io/96k_5_2ch.opus similarity index 100% rename from test/assets/io/96k_5_2ch.opus rename to test/torchaudio_unittest/assets/io/96k_5_2ch.opus diff --git a/test/assets/io/generate_opus.py b/test/torchaudio_unittest/assets/io/generate_opus.py similarity index 100% rename from test/assets/io/generate_opus.py rename to test/torchaudio_unittest/assets/io/generate_opus.py diff --git a/test/assets/kaldi/resample-16000-1000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-1000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-1000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-1000.ark diff --git a/test/assets/kaldi/resample-16000-10000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-10000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-10000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-10000.ark diff --git a/test/assets/kaldi/resample-16000-11000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-11000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-11000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-11000.ark diff --git a/test/assets/kaldi/resample-16000-12000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-12000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-12000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-12000.ark diff --git a/test/assets/kaldi/resample-16000-13000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-13000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-13000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-13000.ark diff --git a/test/assets/kaldi/resample-16000-14000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-14000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-14000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-14000.ark diff --git a/test/assets/kaldi/resample-16000-15000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-15000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-15000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-15000.ark diff --git a/test/assets/kaldi/resample-16000-16000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-16000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-16000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-16000.ark diff --git a/test/assets/kaldi/resample-16000-17000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-17000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-17000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-17000.ark diff --git a/test/assets/kaldi/resample-16000-18000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-18000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-18000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-18000.ark diff --git a/test/assets/kaldi/resample-16000-19000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-19000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-19000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-19000.ark diff --git a/test/assets/kaldi/resample-16000-2000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-2000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-2000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-2000.ark diff --git a/test/assets/kaldi/resample-16000-20000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-20000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-20000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-20000.ark diff --git a/test/assets/kaldi/resample-16000-21000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-21000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-21000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-21000.ark diff --git a/test/assets/kaldi/resample-16000-22000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-22000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-22000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-22000.ark diff --git a/test/assets/kaldi/resample-16000-23000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-23000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-23000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-23000.ark diff --git a/test/assets/kaldi/resample-16000-24000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-24000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-24000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-24000.ark diff --git a/test/assets/kaldi/resample-16000-25000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-25000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-25000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-25000.ark diff --git a/test/assets/kaldi/resample-16000-26000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-26000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-26000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-26000.ark diff --git a/test/assets/kaldi/resample-16000-27000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-27000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-27000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-27000.ark diff --git a/test/assets/kaldi/resample-16000-28000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-28000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-28000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-28000.ark diff --git a/test/assets/kaldi/resample-16000-29000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-29000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-29000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-29000.ark diff --git a/test/assets/kaldi/resample-16000-3000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-3000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-3000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-3000.ark diff --git a/test/assets/kaldi/resample-16000-30000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-30000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-30000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-30000.ark diff --git a/test/assets/kaldi/resample-16000-31000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-31000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-31000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-31000.ark diff --git a/test/assets/kaldi/resample-16000-32000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-32000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-32000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-32000.ark diff --git a/test/assets/kaldi/resample-16000-4000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-4000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-4000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-4000.ark diff --git a/test/assets/kaldi/resample-16000-5000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-5000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-5000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-5000.ark diff --git a/test/assets/kaldi/resample-16000-6000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-6000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-6000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-6000.ark diff --git a/test/assets/kaldi/resample-16000-7000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-7000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-7000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-7000.ark diff --git a/test/assets/kaldi/resample-16000-8000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-8000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-8000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-8000.ark diff --git a/test/assets/kaldi/resample-16000-9000.ark b/test/torchaudio_unittest/assets/kaldi/resample-16000-9000.ark similarity index 100% rename from test/assets/kaldi/resample-16000-9000.ark rename to test/torchaudio_unittest/assets/kaldi/resample-16000-9000.ark diff --git a/test/assets/kaldi_file.wav b/test/torchaudio_unittest/assets/kaldi_file.wav similarity index 100% rename from test/assets/kaldi_file.wav rename to test/torchaudio_unittest/assets/kaldi_file.wav diff --git a/test/assets/kaldi_file_8000.wav b/test/torchaudio_unittest/assets/kaldi_file_8000.wav similarity index 100% rename from test/assets/kaldi_file_8000.wav rename to test/torchaudio_unittest/assets/kaldi_file_8000.wav diff --git a/test/assets/kaldi_test_fbank_args.json b/test/torchaudio_unittest/assets/kaldi_test_fbank_args.json similarity index 100% rename from test/assets/kaldi_test_fbank_args.json rename to test/torchaudio_unittest/assets/kaldi_test_fbank_args.json diff --git a/test/assets/kaldi_test_mfcc_args.json b/test/torchaudio_unittest/assets/kaldi_test_mfcc_args.json similarity index 100% rename from test/assets/kaldi_test_mfcc_args.json rename to test/torchaudio_unittest/assets/kaldi_test_mfcc_args.json diff --git a/test/assets/kaldi_test_spectrogram_args.json b/test/torchaudio_unittest/assets/kaldi_test_spectrogram_args.json similarity index 100% rename from test/assets/kaldi_test_spectrogram_args.json rename to test/torchaudio_unittest/assets/kaldi_test_spectrogram_args.json diff --git a/test/assets/mat.ark b/test/torchaudio_unittest/assets/mat.ark similarity index 100% rename from test/assets/mat.ark rename to test/torchaudio_unittest/assets/mat.ark diff --git a/test/assets/sinewave.wav b/test/torchaudio_unittest/assets/sinewave.wav similarity index 100% rename from test/assets/sinewave.wav rename to test/torchaudio_unittest/assets/sinewave.wav diff --git a/test/assets/sox_effect_test_args.json b/test/torchaudio_unittest/assets/sox_effect_test_args.json similarity index 100% rename from test/assets/sox_effect_test_args.json rename to test/torchaudio_unittest/assets/sox_effect_test_args.json diff --git a/test/assets/sox_effect_test_fir_coeffs.txt b/test/torchaudio_unittest/assets/sox_effect_test_fir_coeffs.txt similarity index 100% rename from test/assets/sox_effect_test_fir_coeffs.txt rename to test/torchaudio_unittest/assets/sox_effect_test_fir_coeffs.txt diff --git a/test/assets/steam-train-whistle-daniel_simon.mp3 b/test/torchaudio_unittest/assets/steam-train-whistle-daniel_simon.mp3 similarity index 100% rename from test/assets/steam-train-whistle-daniel_simon.mp3 rename to test/torchaudio_unittest/assets/steam-train-whistle-daniel_simon.mp3 diff --git a/test/assets/steam-train-whistle-daniel_simon.wav b/test/torchaudio_unittest/assets/steam-train-whistle-daniel_simon.wav similarity index 100% rename from test/assets/steam-train-whistle-daniel_simon.wav rename to test/torchaudio_unittest/assets/steam-train-whistle-daniel_simon.wav diff --git a/test/assets/vad-go-mono-32000.wav b/test/torchaudio_unittest/assets/vad-go-mono-32000.wav similarity index 100% rename from test/assets/vad-go-mono-32000.wav rename to test/torchaudio_unittest/assets/vad-go-mono-32000.wav diff --git a/test/assets/vad-go-stereo-44100.wav b/test/torchaudio_unittest/assets/vad-go-stereo-44100.wav similarity index 100% rename from test/assets/vad-go-stereo-44100.wav rename to test/torchaudio_unittest/assets/vad-go-stereo-44100.wav diff --git a/test/assets/vec_flt.ark b/test/torchaudio_unittest/assets/vec_flt.ark similarity index 100% rename from test/assets/vec_flt.ark rename to test/torchaudio_unittest/assets/vec_flt.ark diff --git a/test/assets/vec_int.ark b/test/torchaudio_unittest/assets/vec_int.ark similarity index 100% rename from test/assets/vec_int.ark rename to test/torchaudio_unittest/assets/vec_int.ark diff --git a/test/test_backend.py b/test/torchaudio_unittest/backend_test.py similarity index 96% rename from test/test_backend.py rename to test/torchaudio_unittest/backend_test.py index 6b67cb2898..d7a2078a31 100644 --- a/test/test_backend.py +++ b/test/torchaudio_unittest/backend_test.py @@ -1,6 +1,6 @@ import torchaudio -from . import common_utils +from torchaudio_unittest import common_utils class BackendSwitchMixin: diff --git a/test/test_batch_consistency.py b/test/torchaudio_unittest/batch_consistency_test.py similarity index 99% rename from test/test_batch_consistency.py rename to test/torchaudio_unittest/batch_consistency_test.py index 6e89bbb235..696b714df1 100644 --- a/test/test_batch_consistency.py +++ b/test/torchaudio_unittest/batch_consistency_test.py @@ -7,7 +7,7 @@ import torchaudio import torchaudio.functional as F -from . import common_utils +from torchaudio_unittest import common_utils class TestFunctional(common_utils.TorchaudioTestCase): diff --git a/test/common_utils/__init__.py b/test/torchaudio_unittest/common_utils/__init__.py similarity index 100% rename from test/common_utils/__init__.py rename to test/torchaudio_unittest/common_utils/__init__.py diff --git a/test/common_utils/backend_utils.py b/test/torchaudio_unittest/common_utils/backend_utils.py similarity index 100% rename from test/common_utils/backend_utils.py rename to test/torchaudio_unittest/common_utils/backend_utils.py diff --git a/test/common_utils/case_utils.py b/test/torchaudio_unittest/common_utils/case_utils.py similarity index 100% rename from test/common_utils/case_utils.py rename to test/torchaudio_unittest/common_utils/case_utils.py diff --git a/test/common_utils/data_utils.py b/test/torchaudio_unittest/common_utils/data_utils.py similarity index 100% rename from test/common_utils/data_utils.py rename to test/torchaudio_unittest/common_utils/data_utils.py diff --git a/test/common_utils/parameterized_utils.py b/test/torchaudio_unittest/common_utils/parameterized_utils.py similarity index 100% rename from test/common_utils/parameterized_utils.py rename to test/torchaudio_unittest/common_utils/parameterized_utils.py diff --git a/test/common_utils/sox_utils.py b/test/torchaudio_unittest/common_utils/sox_utils.py similarity index 100% rename from test/common_utils/sox_utils.py rename to test/torchaudio_unittest/common_utils/sox_utils.py diff --git a/test/common_utils/wav_utils.py b/test/torchaudio_unittest/common_utils/wav_utils.py similarity index 100% rename from test/common_utils/wav_utils.py rename to test/torchaudio_unittest/common_utils/wav_utils.py diff --git a/test/compliance/__init__.py b/test/torchaudio_unittest/compliance/__init__.py similarity index 100% rename from test/compliance/__init__.py rename to test/torchaudio_unittest/compliance/__init__.py diff --git a/test/compliance/generate_fbank_data.py b/test/torchaudio_unittest/compliance/generate_fbank_data.py similarity index 100% rename from test/compliance/generate_fbank_data.py rename to test/torchaudio_unittest/compliance/generate_fbank_data.py diff --git a/test/compliance/generate_test_stft_data.py b/test/torchaudio_unittest/compliance/generate_test_stft_data.py similarity index 100% rename from test/compliance/generate_test_stft_data.py rename to test/torchaudio_unittest/compliance/generate_test_stft_data.py diff --git a/test/compliance/utils.py b/test/torchaudio_unittest/compliance/utils.py similarity index 100% rename from test/compliance/utils.py rename to test/torchaudio_unittest/compliance/utils.py diff --git a/test/test_compliance_kaldi.py b/test/torchaudio_unittest/compliance_kaldi_test.py similarity index 99% rename from test/test_compliance_kaldi.py rename to test/torchaudio_unittest/compliance_kaldi_test.py index c1b9250612..43e9865e2f 100644 --- a/test/test_compliance_kaldi.py +++ b/test/torchaudio_unittest/compliance_kaldi_test.py @@ -6,7 +6,7 @@ import torchaudio import torchaudio.compliance.kaldi as kaldi -from . import common_utils +from torchaudio_unittest import common_utils from .compliance import utils as compliance_utils diff --git a/test/test_dataloader.py b/test/torchaudio_unittest/dataloader_test.py similarity index 96% rename from test/test_dataloader.py rename to test/torchaudio_unittest/dataloader_test.py index 6d1518b70c..8f1d7e6fb3 100644 --- a/test/test_dataloader.py +++ b/test/torchaudio_unittest/dataloader_test.py @@ -3,7 +3,7 @@ import torchaudio from torch.utils.data import Dataset, DataLoader -from . import common_utils +from torchaudio_unittest import common_utils class TORCHAUDIODS(Dataset): diff --git a/test/datasets/__init__.py b/test/torchaudio_unittest/datasets/__init__.py similarity index 100% rename from test/datasets/__init__.py rename to test/torchaudio_unittest/datasets/__init__.py diff --git a/test/datasets/cmuarctic_test.py b/test/torchaudio_unittest/datasets/cmuarctic_test.py similarity index 97% rename from test/datasets/cmuarctic_test.py rename to test/torchaudio_unittest/datasets/cmuarctic_test.py index 499484ffc8..578b0ec385 100644 --- a/test/datasets/cmuarctic_test.py +++ b/test/torchaudio_unittest/datasets/cmuarctic_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets import cmuarctic -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/commonvoice_test.py b/test/torchaudio_unittest/datasets/commonvoice_test.py similarity index 98% rename from test/datasets/commonvoice_test.py rename to test/torchaudio_unittest/datasets/commonvoice_test.py index 320d7208aa..3eedebec70 100644 --- a/test/datasets/commonvoice_test.py +++ b/test/torchaudio_unittest/datasets/commonvoice_test.py @@ -3,7 +3,7 @@ import random from torchaudio.datasets import commonvoice -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/datasets_test.py b/test/torchaudio_unittest/datasets/datasets_test.py similarity index 88% rename from test/datasets/datasets_test.py rename to test/torchaudio_unittest/datasets/datasets_test.py index 0aabefb603..cd04c4d447 100644 --- a/test/datasets/datasets_test.py +++ b/test/torchaudio_unittest/datasets/datasets_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets.speechcommands import SPEECHCOMMANDS from torchaudio.datasets.vctk import VCTK -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TorchaudioTestCase, get_asset_path, ) diff --git a/test/datasets/gtzan_test.py b/test/torchaudio_unittest/datasets/gtzan_test.py similarity index 98% rename from test/datasets/gtzan_test.py rename to test/torchaudio_unittest/datasets/gtzan_test.py index 14c82a512a..3236535fad 100644 --- a/test/datasets/gtzan_test.py +++ b/test/torchaudio_unittest/datasets/gtzan_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets import gtzan -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/librispeech_test.py b/test/torchaudio_unittest/datasets/librispeech_test.py similarity index 98% rename from test/datasets/librispeech_test.py rename to test/torchaudio_unittest/datasets/librispeech_test.py index 728d5f692c..669b428876 100644 --- a/test/datasets/librispeech_test.py +++ b/test/torchaudio_unittest/datasets/librispeech_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets import librispeech -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/libritts_test.py b/test/torchaudio_unittest/datasets/libritts_test.py similarity index 98% rename from test/datasets/libritts_test.py rename to test/torchaudio_unittest/datasets/libritts_test.py index 97b47837bf..639098446b 100644 --- a/test/datasets/libritts_test.py +++ b/test/torchaudio_unittest/datasets/libritts_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets.libritts import LIBRITTS -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/ljspeech_test.py b/test/torchaudio_unittest/datasets/ljspeech_test.py similarity index 98% rename from test/datasets/ljspeech_test.py rename to test/torchaudio_unittest/datasets/ljspeech_test.py index 140d0fe91a..7c1128c31b 100644 --- a/test/datasets/ljspeech_test.py +++ b/test/torchaudio_unittest/datasets/ljspeech_test.py @@ -3,7 +3,7 @@ from torchaudio.datasets import ljspeech -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/speechcommands_test.py b/test/torchaudio_unittest/datasets/speechcommands_test.py similarity index 98% rename from test/datasets/speechcommands_test.py rename to test/torchaudio_unittest/datasets/speechcommands_test.py index 9ef62cda8a..7df1ea2007 100644 --- a/test/datasets/speechcommands_test.py +++ b/test/torchaudio_unittest/datasets/speechcommands_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets import speechcommands -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/datasets/utils_test.py b/test/torchaudio_unittest/datasets/utils_test.py similarity index 97% rename from test/datasets/utils_test.py rename to test/torchaudio_unittest/datasets/utils_test.py index 4218094c14..f75ae2319c 100644 --- a/test/datasets/utils_test.py +++ b/test/torchaudio_unittest/datasets/utils_test.py @@ -4,7 +4,7 @@ from torchaudio.datasets import utils as dataset_utils from torchaudio.datasets.commonvoice import COMMONVOICE -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_asset_path, diff --git a/test/datasets/yesno_test.py b/test/torchaudio_unittest/datasets/yesno_test.py similarity index 96% rename from test/datasets/yesno_test.py rename to test/torchaudio_unittest/datasets/yesno_test.py index 4ae120ef73..a8a8a04276 100644 --- a/test/datasets/yesno_test.py +++ b/test/torchaudio_unittest/datasets/yesno_test.py @@ -2,7 +2,7 @@ from torchaudio.datasets import yesno -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, get_whitenoise, diff --git a/test/sox_effect/__init__.py b/test/torchaudio_unittest/functional/__init__.py similarity index 100% rename from test/sox_effect/__init__.py rename to test/torchaudio_unittest/functional/__init__.py diff --git a/test/functional_cpu_test.py b/test/torchaudio_unittest/functional/functional_cpu_test.py similarity index 99% rename from test/functional_cpu_test.py rename to test/torchaudio_unittest/functional/functional_cpu_test.py index 7fa2520b24..96aac4e770 100644 --- a/test/functional_cpu_test.py +++ b/test/torchaudio_unittest/functional/functional_cpu_test.py @@ -7,7 +7,7 @@ from parameterized import parameterized import pytest -from . import common_utils +from torchaudio_unittest import common_utils from .functional_impl import Lfilter diff --git a/test/functional_cuda_test.py b/test/torchaudio_unittest/functional/functional_cuda_test.py similarity index 88% rename from test/functional_cuda_test.py rename to test/torchaudio_unittest/functional/functional_cuda_test.py index 9602dcf071..80ac5fa0c2 100644 --- a/test/functional_cuda_test.py +++ b/test/torchaudio_unittest/functional/functional_cuda_test.py @@ -1,6 +1,6 @@ import torch -from . import common_utils +from torchaudio_unittest import common_utils from .functional_impl import Lfilter diff --git a/test/functional_impl.py b/test/torchaudio_unittest/functional/functional_impl.py similarity index 96% rename from test/functional_impl.py rename to test/torchaudio_unittest/functional/functional_impl.py index fb5e7dc7ac..c63001a68e 100644 --- a/test/functional_impl.py +++ b/test/torchaudio_unittest/functional/functional_impl.py @@ -2,7 +2,7 @@ import torch import torchaudio.functional as F -from . import common_utils +from torchaudio_unittest import common_utils class Lfilter(common_utils.TestBaseMixin): diff --git a/test/test_io.py b/test/torchaudio_unittest/io_test.py similarity index 99% rename from test/test_io.py rename to test/torchaudio_unittest/io_test.py index 63240cfb7b..e30f4c3fd3 100644 --- a/test/test_io.py +++ b/test/torchaudio_unittest/io_test.py @@ -9,7 +9,7 @@ from torchaudio.utils import sox_utils from torchaudio._internal.module_utils import is_module_available -from .common_utils import get_asset_path +from torchaudio_unittest.common_utils import get_asset_path BACKENDS = [] BACKENDS_MP3 = [] diff --git a/test/kaldi_compatibility_cpu_test.py b/test/torchaudio_unittest/kaldi_compatibility_cpu_test.py similarity index 87% rename from test/kaldi_compatibility_cpu_test.py rename to test/torchaudio_unittest/kaldi_compatibility_cpu_test.py index 3357123296..43be412b47 100644 --- a/test/kaldi_compatibility_cpu_test.py +++ b/test/torchaudio_unittest/kaldi_compatibility_cpu_test.py @@ -1,6 +1,6 @@ import torch -from . import common_utils +from torchaudio_unittest import common_utils from .kaldi_compatibility_impl import Kaldi diff --git a/test/kaldi_compatibility_cuda_test.py b/test/torchaudio_unittest/kaldi_compatibility_cuda_test.py similarity index 88% rename from test/kaldi_compatibility_cuda_test.py rename to test/torchaudio_unittest/kaldi_compatibility_cuda_test.py index e23dbf3f40..28adb7fce5 100644 --- a/test/kaldi_compatibility_cuda_test.py +++ b/test/torchaudio_unittest/kaldi_compatibility_cuda_test.py @@ -1,6 +1,6 @@ import torch -from . import common_utils +from torchaudio_unittest import common_utils from .kaldi_compatibility_impl import Kaldi diff --git a/test/kaldi_compatibility_impl.py b/test/torchaudio_unittest/kaldi_compatibility_impl.py similarity index 98% rename from test/kaldi_compatibility_impl.py rename to test/torchaudio_unittest/kaldi_compatibility_impl.py index 7e51620f63..bae01203f1 100644 --- a/test/kaldi_compatibility_impl.py +++ b/test/torchaudio_unittest/kaldi_compatibility_impl.py @@ -7,7 +7,7 @@ import torchaudio.compliance.kaldi from parameterized import parameterized -from .common_utils import ( +from torchaudio_unittest.common_utils import ( TestBaseMixin, load_params, skipIfNoExec, diff --git a/test/test_kaldi_io.py b/test/torchaudio_unittest/kaldi_io_test.py similarity index 96% rename from test/test_kaldi_io.py rename to test/torchaudio_unittest/kaldi_io_test.py index 80e6b3dc5a..2153b4cc02 100644 --- a/test/test_kaldi_io.py +++ b/test/torchaudio_unittest/kaldi_io_test.py @@ -3,7 +3,7 @@ import torch import torchaudio.kaldi_io as kio -from . import common_utils +from torchaudio_unittest import common_utils class Test_KaldiIO(common_utils.TorchaudioTestCase): diff --git a/test/test_librosa_compatibility.py b/test/torchaudio_unittest/librosa_compatibility_test.py similarity index 99% rename from test/test_librosa_compatibility.py rename to test/torchaudio_unittest/librosa_compatibility_test.py index 01b0f23732..f779f36dae 100644 --- a/test/test_librosa_compatibility.py +++ b/test/torchaudio_unittest/librosa_compatibility_test.py @@ -17,7 +17,7 @@ import pytest -from . import common_utils +from torchaudio_unittest import common_utils @unittest.skipIf(not LIBROSA_AVAILABLE, "Librosa not available") diff --git a/test/test_models.py b/test/torchaudio_unittest/models_test.py similarity index 98% rename from test/test_models.py rename to test/torchaudio_unittest/models_test.py index a37ef66d77..f9e96edd27 100644 --- a/test/test_models.py +++ b/test/torchaudio_unittest/models_test.py @@ -1,7 +1,7 @@ import torch from torchaudio.models import Wav2Letter, MelResNet, UpsampleNetwork, WaveRNN -from . import common_utils +from torchaudio_unittest import common_utils class TestWav2Letter(common_utils.TorchaudioTestCase): diff --git a/test/test_sox_compatibility.py b/test/torchaudio_unittest/sox_compatibility_test.py similarity index 99% rename from test/test_sox_compatibility.py rename to test/torchaudio_unittest/sox_compatibility_test.py index 260c435b83..ade98b2aeb 100644 --- a/test/test_sox_compatibility.py +++ b/test/torchaudio_unittest/sox_compatibility_test.py @@ -5,7 +5,7 @@ import torchaudio.transforms as T from parameterized import parameterized -from .common_utils import ( +from torchaudio_unittest.common_utils import ( skipIfNoSoxBackend, skipIfNoExec, TempDirMixin, diff --git a/test/sox_io_backend/__init__.py b/test/torchaudio_unittest/sox_effect/__init__.py similarity index 100% rename from test/sox_io_backend/__init__.py rename to test/torchaudio_unittest/sox_effect/__init__.py diff --git a/test/sox_effect/common.py b/test/torchaudio_unittest/sox_effect/common.py similarity index 92% rename from test/sox_effect/common.py rename to test/torchaudio_unittest/sox_effect/common.py index 86edcf6476..00ac4a4565 100644 --- a/test/sox_effect/common.py +++ b/test/torchaudio_unittest/sox_effect/common.py @@ -2,7 +2,7 @@ from parameterized import param -from ..common_utils import get_asset_path +from torchaudio_unittest.common_utils import get_asset_path def name_func(func, _, params): diff --git a/test/sox_effect/test_dataset.py b/test/torchaudio_unittest/sox_effect/dataset_test.py similarity index 98% rename from test/sox_effect/test_dataset.py rename to test/torchaudio_unittest/sox_effect/dataset_test.py index f1b71eb806..e98095d0dd 100644 --- a/test/sox_effect/test_dataset.py +++ b/test/torchaudio_unittest/sox_effect/dataset_test.py @@ -4,7 +4,7 @@ import torch import torchaudio -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExtension, diff --git a/test/sox_effect/smoke_test.py b/test/torchaudio_unittest/sox_effect/smoke_test.py similarity index 97% rename from test/sox_effect/smoke_test.py rename to test/torchaudio_unittest/sox_effect/smoke_test.py index 4997002170..996c62063f 100644 --- a/test/sox_effect/smoke_test.py +++ b/test/torchaudio_unittest/sox_effect/smoke_test.py @@ -1,7 +1,7 @@ from torchaudio import sox_effects from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, skipIfNoExtension, diff --git a/test/sox_effect/test_sox_effect.py b/test/torchaudio_unittest/sox_effect/sox_effect_test.py similarity index 99% rename from test/sox_effect/test_sox_effect.py rename to test/torchaudio_unittest/sox_effect/sox_effect_test.py index 38ab0fa772..27740ca576 100644 --- a/test/sox_effect/test_sox_effect.py +++ b/test/torchaudio_unittest/sox_effect/sox_effect_test.py @@ -3,7 +3,7 @@ from torchaudio import sox_effects from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExtension, diff --git a/test/sox_effect/sox_effects_chain_test.py b/test/torchaudio_unittest/sox_effect/sox_effects_chain_test.py similarity index 100% rename from test/sox_effect/sox_effects_chain_test.py rename to test/torchaudio_unittest/sox_effect/sox_effects_chain_test.py diff --git a/test/sox_effect/test_torchscript.py b/test/torchaudio_unittest/sox_effect/torchscript_test.py similarity index 98% rename from test/sox_effect/test_torchscript.py rename to test/torchaudio_unittest/sox_effect/torchscript_test.py index ded923ab11..8e1a9a3980 100644 --- a/test/sox_effect/test_torchscript.py +++ b/test/torchaudio_unittest/sox_effect/torchscript_test.py @@ -4,7 +4,7 @@ from torchaudio import sox_effects from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExtension, diff --git a/test/utils/__init__.py b/test/torchaudio_unittest/sox_io_backend/__init__.py similarity index 100% rename from test/utils/__init__.py rename to test/torchaudio_unittest/sox_io_backend/__init__.py diff --git a/test/sox_io_backend/common.py b/test/torchaudio_unittest/sox_io_backend/common.py similarity index 100% rename from test/sox_io_backend/common.py rename to test/torchaudio_unittest/sox_io_backend/common.py diff --git a/test/sox_io_backend/test_info.py b/test/torchaudio_unittest/sox_io_backend/info_test.py similarity index 98% rename from test/sox_io_backend/test_info.py rename to test/torchaudio_unittest/sox_io_backend/info_test.py index da5207a7e5..f07b72e112 100644 --- a/test/sox_io_backend/test_info.py +++ b/test/torchaudio_unittest/sox_io_backend/info_test.py @@ -3,7 +3,7 @@ from torchaudio.backend import sox_io_backend -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExec, diff --git a/test/sox_io_backend/test_load.py b/test/torchaudio_unittest/sox_io_backend/load_test.py similarity index 99% rename from test/sox_io_backend/test_load.py rename to test/torchaudio_unittest/sox_io_backend/load_test.py index 8366a01f83..1ff8b76dc5 100644 --- a/test/sox_io_backend/test_load.py +++ b/test/torchaudio_unittest/sox_io_backend/load_test.py @@ -3,7 +3,7 @@ from torchaudio.backend import sox_io_backend from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExec, diff --git a/test/sox_io_backend/test_roundtrip.py b/test/torchaudio_unittest/sox_io_backend/roundtrip_test.py similarity index 97% rename from test/sox_io_backend/test_roundtrip.py rename to test/torchaudio_unittest/sox_io_backend/roundtrip_test.py index 2a051bebd5..85aa3019e0 100644 --- a/test/sox_io_backend/test_roundtrip.py +++ b/test/torchaudio_unittest/sox_io_backend/roundtrip_test.py @@ -3,7 +3,7 @@ from torchaudio.backend import sox_io_backend from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExec, diff --git a/test/sox_io_backend/test_save.py b/test/torchaudio_unittest/sox_io_backend/save_test.py similarity index 99% rename from test/sox_io_backend/test_save.py rename to test/torchaudio_unittest/sox_io_backend/save_test.py index 53588c456b..8e416b7aa9 100644 --- a/test/sox_io_backend/test_save.py +++ b/test/torchaudio_unittest/sox_io_backend/save_test.py @@ -3,7 +3,7 @@ from torchaudio.backend import sox_io_backend from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, PytorchTestCase, skipIfNoExec, diff --git a/test/sox_io_backend/smoke_test.py b/test/torchaudio_unittest/sox_io_backend/smoke_test.py similarity index 98% rename from test/sox_io_backend/smoke_test.py rename to test/torchaudio_unittest/sox_io_backend/smoke_test.py index 1ae9a8d938..be734afa77 100644 --- a/test/sox_io_backend/smoke_test.py +++ b/test/torchaudio_unittest/sox_io_backend/smoke_test.py @@ -6,7 +6,7 @@ from torchaudio._internal.module_utils import is_module_available from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, skipIfNoExtension, diff --git a/test/sox_io_backend/test_torchscript.py b/test/torchaudio_unittest/sox_io_backend/torchscript_test.py similarity index 99% rename from test/sox_io_backend/test_torchscript.py rename to test/torchaudio_unittest/sox_io_backend/torchscript_test.py index 9a30aab0d2..dad678cbc0 100644 --- a/test/sox_io_backend/test_torchscript.py +++ b/test/torchaudio_unittest/sox_io_backend/torchscript_test.py @@ -5,7 +5,7 @@ import torchaudio from parameterized import parameterized -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( TempDirMixin, TorchaudioTestCase, skipIfNoExec, diff --git a/test/torchscript_consistency_cpu_test.py b/test/torchaudio_unittest/torchscript_consistency_cpu_test.py similarity index 93% rename from test/torchscript_consistency_cpu_test.py rename to test/torchaudio_unittest/torchscript_consistency_cpu_test.py index 38fe7961fd..fcc9cb8389 100644 --- a/test/torchscript_consistency_cpu_test.py +++ b/test/torchaudio_unittest/torchscript_consistency_cpu_test.py @@ -1,6 +1,6 @@ import torch -from . import common_utils +from torchaudio_unittest import common_utils from .torchscript_consistency_impl import Functional, Transforms diff --git a/test/torchscript_consistency_cuda_test.py b/test/torchaudio_unittest/torchscript_consistency_cuda_test.py similarity index 94% rename from test/torchscript_consistency_cuda_test.py rename to test/torchaudio_unittest/torchscript_consistency_cuda_test.py index b317334ce4..c205e192ed 100644 --- a/test/torchscript_consistency_cuda_test.py +++ b/test/torchaudio_unittest/torchscript_consistency_cuda_test.py @@ -1,6 +1,6 @@ import torch -from . import common_utils +from torchaudio_unittest import common_utils from .torchscript_consistency_impl import Functional, Transforms diff --git a/test/torchscript_consistency_impl.py b/test/torchaudio_unittest/torchscript_consistency_impl.py similarity index 99% rename from test/torchscript_consistency_impl.py rename to test/torchaudio_unittest/torchscript_consistency_impl.py index 76444dc18a..8d14e538fd 100644 --- a/test/torchscript_consistency_impl.py +++ b/test/torchaudio_unittest/torchscript_consistency_impl.py @@ -5,7 +5,7 @@ import torchaudio.functional as F import torchaudio.transforms as T -from . import common_utils +from torchaudio_unittest import common_utils class Functional(common_utils.TestBaseMixin): diff --git a/test/test_transforms.py b/test/torchaudio_unittest/transforms_test.py similarity index 99% rename from test/test_transforms.py rename to test/torchaudio_unittest/transforms_test.py index f6942e18a5..4a91d40bd9 100644 --- a/test/test_transforms.py +++ b/test/torchaudio_unittest/transforms_test.py @@ -6,7 +6,7 @@ import torchaudio.transforms as transforms import torchaudio.functional as F -from . import common_utils +from torchaudio_unittest import common_utils class Tester(common_utils.TorchaudioTestCase): diff --git a/test/torchaudio_unittest/utils/__init__.py b/test/torchaudio_unittest/utils/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/utils/test_sox_utils.py b/test/torchaudio_unittest/utils/sox_utils_test.py similarity index 97% rename from test/utils/test_sox_utils.py rename to test/torchaudio_unittest/utils/sox_utils_test.py index 55a46a235e..7c206fdc0b 100644 --- a/test/utils/test_sox_utils.py +++ b/test/torchaudio_unittest/utils/sox_utils_test.py @@ -1,6 +1,6 @@ from torchaudio.utils import sox_utils -from ..common_utils import ( +from torchaudio_unittest.common_utils import ( PytorchTestCase, skipIfNoExtension, )