Commit 7d4c9fd
authored
CI: Fix issues caused by pytest v9 (#2904)
Issues with pyproject.toml
Since the recent pytest v9 release, PEFT's pyproject.toml does not work
anymore. This is because it mixes both new and old format new formats
(ini_options), which is no longer allowed.
This PR fixes the issue by switching fully to the new format. Note that
if a pytest version < 9.0.0 is used, the added pytest options will be
ignored. Thus please update to 9.0.0+.
Context: https://github.com/pytest-dev/pytest/releases/tag/9.0.0
Issues with unittest.skip
Since pytest v9, unittest.skip raises an error instead of just skipping
the corresponding test (see these errors). As of writing this, it is
unclear if this will be fixed or not:
pytest-dev/pytest#13895
To avoid the error, we now use pytest.mark.skip insted of unittest.skip
/ unittest.skipUnless.
Tangential changes
1. Remove a few inheritances from unittest.TestCase that were
unnecessary
2. Skip the whole test_gpu_examples.py module if no accelerator is
available (faster than checking each class/function individually)1 parent e82e72a commit 7d4c9fd
File tree
4 files changed
+38
-40
lines changed- tests
4 files changed
+38
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| |||
3460 | 3465 | | |
3461 | 3466 | | |
3462 | 3467 | | |
3463 | | - | |
3464 | | - | |
3465 | | - | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
3466 | 3471 | | |
3467 | 3472 | | |
3468 | 3473 | | |
| |||
3545 | 3550 | | |
3546 | 3551 | | |
3547 | 3552 | | |
3548 | | - | |
3549 | | - | |
3550 | | - | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
3551 | 3556 | | |
3552 | 3557 | | |
3553 | 3558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
| 181 | + | |
183 | 182 | | |
184 | 183 | | |
185 | 184 | | |
| |||
444 | 443 | | |
445 | 444 | | |
446 | 445 | | |
447 | | - | |
| 446 | + | |
448 | 447 | | |
449 | 448 | | |
450 | 449 | | |
| |||
492 | 491 | | |
493 | 492 | | |
494 | 493 | | |
495 | | - | |
| 494 | + | |
496 | 495 | | |
497 | 496 | | |
498 | 497 | | |
| |||
520 | 519 | | |
521 | 520 | | |
522 | 521 | | |
523 | | - | |
| 522 | + | |
524 | 523 | | |
525 | 524 | | |
526 | 525 | | |
| |||
1527 | 1526 | | |
1528 | 1527 | | |
1529 | 1528 | | |
1530 | | - | |
| 1529 | + | |
1531 | 1530 | | |
1532 | 1531 | | |
1533 | 1532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
| 57 | + | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
| 64 | + | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 71 | + | |
76 | 72 | | |
77 | 73 | | |
78 | 74 | | |
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 78 | + | |
| 79 | + | |
86 | 80 | | |
87 | 81 | | |
88 | 82 | | |
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
92 | 86 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
| |||
112 | 107 | | |
113 | 108 | | |
114 | 109 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 110 | + | |
| 111 | + | |
118 | 112 | | |
119 | 113 | | |
120 | 114 | | |
121 | 115 | | |
122 | 116 | | |
123 | 117 | | |
124 | | - | |
| 118 | + | |
125 | 119 | | |
126 | 120 | | |
127 | 121 | | |
128 | 122 | | |
129 | 123 | | |
130 | 124 | | |
131 | | - | |
| 125 | + | |
132 | 126 | | |
133 | 127 | | |
134 | 128 | | |
135 | 129 | | |
136 | 130 | | |
137 | 131 | | |
138 | | - | |
| 132 | + | |
139 | 133 | | |
140 | 134 | | |
141 | 135 | | |
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
145 | | - | |
| 139 | + | |
146 | 140 | | |
147 | 141 | | |
148 | 142 | | |
149 | 143 | | |
150 | 144 | | |
151 | 145 | | |
152 | | - | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
156 | 150 | | |
157 | 151 | | |
158 | 152 | | |
159 | | - | |
| 153 | + | |
160 | 154 | | |
161 | 155 | | |
162 | 156 | | |
163 | 157 | | |
164 | 158 | | |
165 | 159 | | |
166 | | - | |
| 160 | + | |
167 | 161 | | |
168 | 162 | | |
169 | 163 | | |
| |||
0 commit comments