Skip to content

Commit ccda545

Browse files
atalmanfacebook-github-bot
authored andcommitted
Toggle on/off ffmpeg test if needed (#2901)
Summary: Toggle on/off ffmpeg test if needed By default it ON, hence should not affect any current tests. To toggle ON no change required. To toggle OFF use: ``` smoke_test.py --no-ffmpeg ``` To be used when calling from builder currently. Since we do not install ffmpeg currently. Pull Request resolved: #2901 Reviewed By: carolineechen, mthrok Differential Revision: D41874976 Pulled By: atalman fbshipit-source-id: c57b19f37c63a1f476f93a5211550e980e67d9c7
1 parent 41d007b commit ccda545

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

test/smoke_test/smoke_test.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Run smoke tests"""
22

3+
import argparse
4+
35
import torchaudio # noqa: F401
46
import torchaudio.compliance.kaldi # noqa: F401
57
import torchaudio.datasets # noqa: F401
@@ -9,4 +11,22 @@
911
import torchaudio.sox_effects # noqa: F401
1012
import torchaudio.transforms # noqa: F401
1113
import torchaudio.utils # noqa: F401
12-
from torchaudio.io import StreamReader # noqa: F401
14+
15+
16+
def ffmpeg_test():
17+
from torchaudio.io import StreamReader # noqa: F401
18+
19+
20+
def main() -> None:
21+
parser = argparse.ArgumentParser()
22+
23+
# Warning: Please note this option should not be widely used, only use it when absolutely necessary
24+
parser.add_argument("--no-ffmpeg", dest="ffmpeg", action="store_false")
25+
26+
options = parser.parse_args()
27+
if options.ffmpeg:
28+
ffmpeg_test()
29+
30+
31+
if __name__ == "__main__":
32+
main()

0 commit comments

Comments
 (0)