Skip to content

Commit

Permalink
Fix skipIfNoExtension (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok authored Aug 4, 2020
1 parent 08a7127 commit 11b00d5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/common_utils/case_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ def skipIfNoModule(module, display_name=None):


def skipIfNoExtension(test_item):
if (
not is_module_available('torchaudio._torchaudio')
and 'TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION' in os.environ
):
if is_module_available('torchaudio._torchaudio'):
return test_item
if 'TORCHAUDIO_TEST_FAIL_IF_NO_EXTENSION' in os.environ:
raise RuntimeError('torchaudio C++ extension is not available.')
return unittest.skip('torchaudio C++ extension is not available')(test_item)

0 comments on commit 11b00d5

Please sign in to comment.