Skip to content

Commit 8f4c4d2

Browse files
committed
Fix skipIfNoExtension
1 parent 08a7127 commit 8f4c4d2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/common_utils/case_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ def skipIfNoModule(module, display_name=None):
7070

7171

7272
def skipIfNoExtension(test_item):
73-
if (
74-
not is_module_available('torchaudio._torchaudio')
75-
and 'TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION' in os.environ
76-
):
73+
if is_module_available('torchaudio._torchaudio'):
74+
return test_item
75+
if 'TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION' in os.environ:
7776
raise RuntimeError('torchaudio C++ extension is not available.')
7877
return unittest.skip('torchaudio C++ extension is not available')(test_item)

0 commit comments

Comments
 (0)