Skip tests properly (#31308)

* Skip tests properly

* [test_all]

* Add 'reason' as kwarg for skipTest

* [test_all] Fix up

* [test_all]
This commit is contained in:
amyeroberts
2024-06-26 21:59:08 +01:00
committed by GitHub
parent 1f9f57ab4c
commit 1de7dc7403
254 changed files with 1721 additions and 1298 deletions

View File

@@ -70,9 +70,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
if tokenizer is None:
# Side effect of no Fast Tokenizer class for these model, so skipping
# But the slow tokenizer test should still run as they're quite small
self.skipTest("No tokenizer available")
return
# return None, None
self.skipTest(reason="No tokenizer available")
speech_recognizer = AutomaticSpeechRecognitionPipeline(
model=model, tokenizer=tokenizer, feature_extractor=processor
@@ -271,7 +269,7 @@ class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
@require_tf
def test_small_model_tf(self):
self.skipTest("Tensorflow not supported yet.")
self.skipTest(reason="Tensorflow not supported yet.")
@require_torch
def test_torch_small_no_tokenizer_files(self):
@@ -1855,7 +1853,7 @@ def require_ffmpeg(test_case):
subprocess.check_output(["ffmpeg", "-h"], stderr=subprocess.DEVNULL)
return test_case
except Exception:
return unittest.skip("test requires ffmpeg")(test_case)
return unittest.skip(reason="test requires ffmpeg")(test_case)
def bytes_iter(chunk_size, chunks):