@@ -187,6 +187,7 @@ def parse_flag_from_env(key, default=False):
187187
188188_run_slow_tests = parse_flag_from_env ("RUN_SLOW" , default = False )
189189_run_nightly_tests = parse_flag_from_env ("RUN_NIGHTLY" , default = False )
190+ _run_compile_tests = parse_flag_from_env ("RUN_COMPILE" , default = False )
190191
191192
192193def floats_tensor (shape , scale = 1.0 , rng = None , name = None ):
@@ -225,6 +226,16 @@ def nightly(test_case):
225226 return unittest .skipUnless (_run_nightly_tests , "test is nightly" )(test_case )
226227
227228
229+ def is_torch_compile (test_case ):
230+ """
231+ Decorator marking a test that runs compile tests in the diffusers CI.
232+
233+ Compile tests are skipped by default. Set the RUN_COMPILE environment variable to a truthy value to run them.
234+
235+ """
236+ return unittest .skipUnless (_run_compile_tests , "test is torch compile" )(test_case )
237+
238+
228239def require_torch (test_case ):
229240 """
230241 Decorator marking a test that requires PyTorch. These tests are skipped when PyTorch isn't installed.
@@ -390,14 +401,6 @@ def get_python_version():
390401 return major , minor
391402
392403
393- def require_python39_or_higher (test_case ):
394- def python39_available ():
395- major , minor = get_python_version ()
396- return major == 3 and minor >= 9
397-
398- return unittest .skipUnless (python39_available (), "test requires Python 3.9 or higher" )(test_case )
399-
400-
401404def load_numpy (arry : Union [str , np .ndarray ], local_path : Optional [str ] = None ) -> np .ndarray :
402405 if isinstance (arry , str ):
403406 if local_path is not None :
0 commit comments