diff --git a/test/smoke_test/smoke_test.py b/test/smoke_test/smoke_test.py index c7b7c4642f..f3f8342302 100644 --- a/test/smoke_test/smoke_test.py +++ b/test/smoke_test/smoke_test.py @@ -1,5 +1,7 @@ """Run smoke tests""" +import argparse + import torchaudio # noqa: F401 import torchaudio.compliance.kaldi # noqa: F401 import torchaudio.datasets # noqa: F401 @@ -9,4 +11,22 @@ import torchaudio.sox_effects # noqa: F401 import torchaudio.transforms # noqa: F401 import torchaudio.utils # noqa: F401 -from torchaudio.io import StreamReader # noqa: F401 + + +def ffmpeg_test(): + from torchaudio.io import StreamReader # noqa: F401 + + +def main() -> None: + parser = argparse.ArgumentParser() + + # Warning: Please note this option should not be widely used, only use it when absolutely necessary + parser.add_argument("--no-ffmpeg", dest="ffmpeg", action="store_false") + + options = parser.parse_args() + if options.ffmpeg: + ffmpeg_test() + + +if __name__ == "__main__": + main()