def METHOD_NAME(self):
    with self.assertRaisesRegex(
        EnvironmentError,
        "hf-internal-testing/no-config-test-repo does not appear to have a file named config.json.",
    ):
        _ = AutoConfig.from_pretrained("hf-internal-testing/no-config-test-repo")