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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user