Unverified Commit af4a1eca authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Skip tests until bug is fixed. (#17646)

parent e0b58fb5
...@@ -88,6 +88,7 @@ class AutoConfigTest(unittest.TestCase): ...@@ -88,6 +88,7 @@ class AutoConfigTest(unittest.TestCase):
if "custom" in CONFIG_MAPPING._extra_content: if "custom" in CONFIG_MAPPING._extra_content:
del CONFIG_MAPPING._extra_content["custom"] del CONFIG_MAPPING._extra_content["custom"]
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_repo_not_found(self): def test_repo_not_found(self):
with self.assertRaisesRegex( with self.assertRaisesRegex(
EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" EnvironmentError, "bert-base is not a local folder and is not a valid model identifier"
......
...@@ -76,6 +76,7 @@ class AutoFeatureExtractorTest(unittest.TestCase): ...@@ -76,6 +76,7 @@ class AutoFeatureExtractorTest(unittest.TestCase):
config = AutoFeatureExtractor.from_pretrained(SAMPLE_FEATURE_EXTRACTION_CONFIG) config = AutoFeatureExtractor.from_pretrained(SAMPLE_FEATURE_EXTRACTION_CONFIG)
self.assertIsInstance(config, Wav2Vec2FeatureExtractor) self.assertIsInstance(config, Wav2Vec2FeatureExtractor)
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_repo_not_found(self): def test_repo_not_found(self):
with self.assertRaisesRegex( with self.assertRaisesRegex(
EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" EnvironmentError, "bert-base is not a local folder and is not a valid model identifier"
......
...@@ -328,6 +328,7 @@ class AutoModelTest(unittest.TestCase): ...@@ -328,6 +328,7 @@ class AutoModelTest(unittest.TestCase):
if CustomConfig in mapping._extra_content: if CustomConfig in mapping._extra_content:
del mapping._extra_content[CustomConfig] del mapping._extra_content[CustomConfig]
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_repo_not_found(self): def test_repo_not_found(self):
with self.assertRaisesRegex( with self.assertRaisesRegex(
EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" EnvironmentError, "bert-base is not a local folder and is not a valid model identifier"
......
...@@ -77,6 +77,7 @@ class FlaxAutoModelTest(unittest.TestCase): ...@@ -77,6 +77,7 @@ class FlaxAutoModelTest(unittest.TestCase):
eval(**tokens).block_until_ready() eval(**tokens).block_until_ready()
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_repo_not_found(self): def test_repo_not_found(self):
with self.assertRaisesRegex( with self.assertRaisesRegex(
EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" EnvironmentError, "bert-base is not a local folder and is not a valid model identifier"
......
...@@ -265,6 +265,7 @@ class TFAutoModelTest(unittest.TestCase): ...@@ -265,6 +265,7 @@ class TFAutoModelTest(unittest.TestCase):
if NewModelConfig in mapping._extra_content: if NewModelConfig in mapping._extra_content:
del mapping._extra_content[NewModelConfig] del mapping._extra_content[NewModelConfig]
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_repo_not_found(self): def test_repo_not_found(self):
with self.assertRaisesRegex( with self.assertRaisesRegex(
EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" EnvironmentError, "bert-base is not a local folder and is not a valid model identifier"
......
...@@ -142,6 +142,7 @@ class AutoTokenizerTest(unittest.TestCase): ...@@ -142,6 +142,7 @@ class AutoTokenizerTest(unittest.TestCase):
self.assertEqual(tokenizer.model_max_length, 512) self.assertEqual(tokenizer.model_max_length, 512)
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
@require_tokenizers @require_tokenizers
def test_tokenizer_identifier_non_existent(self): def test_tokenizer_identifier_non_existent(self):
for tokenizer_class in [BertTokenizer, BertTokenizerFast, AutoTokenizer]: for tokenizer_class in [BertTokenizer, BertTokenizerFast, AutoTokenizer]:
...@@ -329,6 +330,7 @@ class AutoTokenizerTest(unittest.TestCase): ...@@ -329,6 +330,7 @@ class AutoTokenizerTest(unittest.TestCase):
else: else:
self.assertEqual(tokenizer.__class__.__name__, "NewTokenizer") self.assertEqual(tokenizer.__class__.__name__, "NewTokenizer")
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_repo_not_found(self): def test_repo_not_found(self):
with self.assertRaisesRegex( with self.assertRaisesRegex(
EnvironmentError, "bert-base is not a local folder and is not a valid model identifier" EnvironmentError, "bert-base is not a local folder and is not a valid model identifier"
......
...@@ -99,6 +99,7 @@ class GetFromCacheTests(unittest.TestCase): ...@@ -99,6 +99,7 @@ class GetFromCacheTests(unittest.TestCase):
with self.assertRaisesRegex(EntryNotFoundError, "404 Client Error"): with self.assertRaisesRegex(EntryNotFoundError, "404 Client Error"):
_ = get_from_cache(url) _ = get_from_cache(url)
@unittest.skip("Temp bug in the Hub not returning RepoNotFound errors.")
def test_model_not_found(self): def test_model_not_found(self):
# Invalid model file. # Invalid model file.
url = hf_bucket_url("bert-base", filename="pytorch_model.bin") url = hf_bucket_url("bert-base", filename="pytorch_model.bin")
...@@ -141,8 +142,9 @@ class GetFromCacheTests(unittest.TestCase): ...@@ -141,8 +142,9 @@ class GetFromCacheTests(unittest.TestCase):
self.assertIsNone(get_file_from_repo("bert-base-cased", "ahah.txt")) self.assertIsNone(get_file_from_repo("bert-base-cased", "ahah.txt"))
# The function raises if the repository does not exist. # The function raises if the repository does not exist.
with self.assertRaisesRegex(EnvironmentError, "is not a valid model identifier"): # Uncomment when bug is fixed.
get_file_from_repo("bert-base-case", "config.json") # 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. # The function raises if the revision does not exist.
with self.assertRaisesRegex(EnvironmentError, "is not a valid git identifier"): with self.assertRaisesRegex(EnvironmentError, "is not a valid git identifier"):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment