@@ -45,6 +45,39 @@ def call_f(self):
45
45
return wrapper
46
46
47
47
48
+ def is_azure () -> bool :
49
+ "Tells if the job is running on Azure DevOps."
50
+ return os .environ .get ("AZURE_HTTP_USER_AGENT" , "undefined" ) != "undefined"
51
+
52
+
53
+ def is_windows () -> bool :
54
+ return sys .platform == "win32"
55
+
56
+
57
+ def is_apple () -> bool :
58
+ return sys .platform == "darwin"
59
+
60
+
61
+ def skipif_ci_windows (msg ) -> Callable :
62
+ """
63
+ Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`.
64
+ """
65
+ if is_windows () and is_azure ():
66
+ msg = f"Test does not work on azure pipeline (Windows). { msg } "
67
+ return unittest .skip (msg )
68
+ return lambda x : x
69
+
70
+
71
+ def skipif_ci_apple (msg ) -> Callable :
72
+ """
73
+ Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`.
74
+ """
75
+ if is_apple () and is_azure ():
76
+ msg = f"Test does not work on azure pipeline (Apple). { msg } "
77
+ return unittest .skip (msg )
78
+ return lambda x : x
79
+
80
+
48
81
def measure_time (
49
82
stmt : Union [str , Callable ],
50
83
context : Optional [Dict [str , Any ]] = None ,
@@ -547,36 +580,3 @@ def unzip_files(
547
580
elif not info .filename .endswith ("/" ):
548
581
files .append (tos )
549
582
return files
550
-
551
-
552
- def is_azure () -> bool :
553
- "Tells if the job is running on Azure DevOps."
554
- return os .environ .get ("AZURE_HTTP_USER_AGENT" , "undefined" ) != "undefined"
555
-
556
-
557
- def is_windows () -> bool :
558
- return sys .platform == "win32"
559
-
560
-
561
- def is_apple () -> bool :
562
- return sys .platform == "darwin"
563
-
564
-
565
- def skipif_ci_windows (msg ) -> Callable :
566
- """
567
- Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`.
568
- """
569
- if is_windows () and is_azure ():
570
- msg = f"Test does not work on azure pipeline (Windows). { msg } "
571
- return unittest .skip (msg )
572
- return lambda x : x
573
-
574
-
575
- def skipif_ci_apple (msg ) -> Callable :
576
- """
577
- Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`.
578
- """
579
- if is_apple () and is_azure ():
580
- msg = f"Test does not work on azure pipeline (Apple). { msg } "
581
- return unittest .skip (msg )
582
- return lambda x : x
0 commit comments