2828
2929import  numpy  as  np 
3030import  PIL .Image 
31+ import  pytest 
3132import  requests_mock 
3233import  safetensors .torch 
3334import  torch 
6263)
6364from  diffusers .pipelines .pipeline_utils  import  _get_pipeline_class 
6465from  diffusers .schedulers .scheduling_utils  import  SCHEDULER_CONFIG_NAME 
65- from  diffusers .utils  import  (
66-     CONFIG_NAME ,
67-     WEIGHTS_NAME ,
68- )
66+ from  diffusers .utils  import  CONFIG_NAME , WEIGHTS_NAME , is_transformers_version 
6967from  diffusers .utils .torch_utils  import  is_compiled_module 
7068
7169from  ..testing_utils  import  (
@@ -584,6 +582,7 @@ def test_download_variants_with_sharded_checkpoints(self):
584582                    assert  not  any (f .endswith (unexpected_ext ) for  f  in  files )
585583                    assert  all (variant  in  f  for  f  in  model_files  if  f .endswith (model_ext ) and  variant  is  not   None )
586584
585+     @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True ) 
587586    def  test_download_legacy_variants_with_sharded_ckpts_raises_warning (self ):
588587        repo_id  =  "hf-internal-testing/tiny-stable-diffusion-pipe-variants-all-kinds" 
589588        logger  =  logging .get_logger ("diffusers.pipelines.pipeline_utils" )
@@ -690,6 +689,7 @@ def test_download_bin_variant_does_not_exist_for_model(self):
690689                )
691690            assert  "Error no file name"  in  str (error_context .exception )
692691
692+     @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True ) 
693693    def  test_local_save_load_index (self ):
694694        prompt  =  "hello" 
695695        for  variant  in  [None , "fp16" ]:
@@ -1584,6 +1584,7 @@ def test_save_safe_serialization(self):
15841584            assert  pipeline .scheduler  is  not   None 
15851585            assert  pipeline .feature_extractor  is  not   None 
15861586
1587+     @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True ) 
15871588    def  test_no_pytorch_download_when_doing_safetensors (self ):
15881589        # by default we don't download 
15891590        with  tempfile .TemporaryDirectory () as  tmpdirname :
@@ -1603,6 +1604,7 @@ def test_no_pytorch_download_when_doing_safetensors(self):
16031604            # pytorch does not 
16041605            assert  not  os .path .exists (os .path .join (path , "diffusion_pytorch_model.bin" ))
16051606
1607+     @pytest .mark .xfail (condition = is_transformers_version (">" , "4.56.2" ), reason = "Some import error" , strict = True ) 
16061608    def  test_no_safetensors_download_when_doing_pytorch (self ):
16071609        use_safetensors  =  False 
16081610
0 commit comments