From af4a1ecad0d2d5ad383418c0605430c847eafe57 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Thu, 9 Jun 2022 21:32:19 -0400 Subject: [PATCH] Skip tests until bug is fixed. (#17646) --- tests/models/auto/test_configuration_auto.py | 1 + tests/models/auto/test_feature_extraction_auto.py | 1 + tests/models/auto/test_modeling_auto.py | 1 + tests/models/auto/test_modeling_flax_auto.py | 1 + tests/models/auto/test_modeling_tf_auto.py | 1 + tests/models/auto/test_tokenization_auto.py | 2 ++ tests/utils/test_file_utils.py | 6 ++++-- 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/models/auto/test_configuration_auto.py b/tests/models/auto/test_configuration_auto.py index 2695082c41..473d3ab2bd 100644 --- a/tests/models/auto/test_configuration_auto.py +++ b/tests/models/auto/test_configuration_auto.py @@ -88,6 +88,7 @@ class AutoConfigTest(unittest.TestCase): if "custom" in CONFIG_MAPPING._extra_content: del CONFIG_MAPPING._extra_content["custom"] + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_repo_not_found(self): with self.assertRaisesRegex( EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" diff --git a/tests/models/auto/test_feature_extraction_auto.py b/tests/models/auto/test_feature_extraction_auto.py index e9d044e8da..9bba9b86bd 100644 --- a/tests/models/auto/test_feature_extraction_auto.py +++ b/tests/models/auto/test_feature_extraction_auto.py @@ -76,6 +76,7 @@ class AutoFeatureExtractorTest(unittest.TestCase): config = AutoFeatureExtractor.from_pretrained(SAMPLE_FEATURE_EXTRACTION_CONFIG) self.assertIsInstance(config, Wav2Vec2FeatureExtractor) + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_repo_not_found(self): with self.assertRaisesRegex( EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" diff --git a/tests/models/auto/test_modeling_auto.py b/tests/models/auto/test_modeling_auto.py index 3731d70f5b..ed2cbb60f7 100644 --- a/tests/models/auto/test_modeling_auto.py +++ b/tests/models/auto/test_modeling_auto.py @@ -328,6 +328,7 @@ class AutoModelTest(unittest.TestCase): if CustomConfig in mapping._extra_content: del mapping._extra_content[CustomConfig] + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_repo_not_found(self): with self.assertRaisesRegex( EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" diff --git a/tests/models/auto/test_modeling_flax_auto.py b/tests/models/auto/test_modeling_flax_auto.py index 26f80f9706..70dd8692c8 100644 --- a/tests/models/auto/test_modeling_flax_auto.py +++ b/tests/models/auto/test_modeling_flax_auto.py @@ -77,6 +77,7 @@ class FlaxAutoModelTest(unittest.TestCase): eval(**tokens).block_until_ready() + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_repo_not_found(self): with self.assertRaisesRegex( EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" diff --git a/tests/models/auto/test_modeling_tf_auto.py b/tests/models/auto/test_modeling_tf_auto.py index a803a34511..528557a34e 100644 --- a/tests/models/auto/test_modeling_tf_auto.py +++ b/tests/models/auto/test_modeling_tf_auto.py @@ -265,6 +265,7 @@ class TFAutoModelTest(unittest.TestCase): if NewModelConfig in mapping._extra_content: del mapping._extra_content[NewModelConfig] + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_repo_not_found(self): with self.assertRaisesRegex( EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" diff --git a/tests/models/auto/test_tokenization_auto.py b/tests/models/auto/test_tokenization_auto.py index 1e1abb9245..b8b19a5db0 100644 --- a/tests/models/auto/test_tokenization_auto.py +++ b/tests/models/auto/test_tokenization_auto.py @@ -142,6 +142,7 @@ class AutoTokenizerTest(unittest.TestCase): self.assertEqual(tokenizer.model_max_length, 512) + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") @require_tokenizers def test_tokenizer_identifier_non_existent(self): for tokenizer_class in [BertTokenizer, BertTokenizerFast, AutoTokenizer]: @@ -329,6 +330,7 @@ class AutoTokenizerTest(unittest.TestCase): else: self.assertEqual(tokenizer.__class__.__name__, "NewTokenizer") + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_repo_not_found(self): with self.assertRaisesRegex( EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" diff --git a/tests/utils/test_file_utils.py b/tests/utils/test_file_utils.py index 75c4f19caa..3733cdf326 100644 --- a/tests/utils/test_file_utils.py +++ b/tests/utils/test_file_utils.py @@ -99,6 +99,7 @@ class GetFromCacheTests(unittest.TestCase): with self.assertRaisesRegex(EntryNotFoundError, "404 Client Error"): _ = get_from_cache(url) + @unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.") def test_model_not_found(self): # Invalid model file. url = hf_bucket_url("bert-base", filename="pytorch_model.bin") @@ -141,8 +142,9 @@ class GetFromCacheTests(unittest.TestCase): self.assertIsNone(get_file_from_repo("bert-base-cased", "ahah.txt")) # The function raises if the repository does not exist. - with self.assertRaisesRegex(EnvironmentError, "is not a valid model identifier"): - get_file_from_repo("bert-base-case", "config.json") + # Uncomment when bug is fixed. + # with self.assertRaisesRegex(EnvironmentError, "is not a valid model identifier"): + # get_file_from_repo("bert-base-case", "config.json") # The function raises if the revision does not exist. with self.assertRaisesRegex(EnvironmentError, "is not a valid git identifier"):