Commit 1149236
[tests] guard peft imports in test_lora_loader_utils
The Hub staging-tests job runs `pytest -m "is_staging_test" tests`, which
imports every test module at collection time, but that job doesn't install
peft. The top-level `from peft import ...` added in #14385 therefore breaks
collection with exit code 2 on every PR.
Guard the imports behind `is_peft_available()` (as `tests/lora/utils.py`
already does) and mark the one test that needs them with
`require_peft_backend`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent d6726f3 commit 1149236
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
0 commit comments