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

@@ -387,7 +387,7 @@ class PerceiverModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCas
def test_training(self):
if not self.model_tester.is_training:
return
self.skipTest(reason="model_tester.is_training is set to False")
for model_class in self.all_model_classes:
if model_class.__name__ in [
@@ -732,7 +732,7 @@ class PerceiverModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCas
def test_correct_missing_keys(self):
if not self.test_missing_keys:
return
self.skipTest(reason="test_missing_keys is set to False")
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:

View File

@@ -270,15 +270,16 @@ class PerceiverTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
tokenizer = self.perceiver_tokenizer
self.assertEqual(tokenizer.decode([178]), "<EFBFBD>")
# tokenizer does not have vocabulary
@unittest.skip(reason="tokenizer does not have vocabulary")
def test_get_vocab(self):
pass
# inputs cannot be pretokenized since ids depend on whole input string and not just on single characters
@unittest.skip(reason="inputs cannot be pretokenized")
def test_pretokenized_inputs(self):
# inputs cannot be pretokenized since ids depend on whole input string and not just on single characters
pass
# tests all ids in vocab => vocab doesn't exist so unnecessary to test
@unittest.skip(reason="vocab does not exist")
def test_conversion_reversible(self):
pass