# pytest.skip.Exception: Skipped: no module named 'requests'

- **ID:** `python/pytest-mark-skip-missing-import`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

在测试中调用 pytest.skip() 但条件判断错误，或者 @pytest.mark.skipif 条件未正确评估。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |

## Workarounds

1. **使用 importorskip** (98% success)
   ```
   import pytest
requests = pytest.importorskip('requests')
   ```
2. **使用 skipif 装饰器** (90% success)
   ```
   @pytest.mark.skipif(not ORG, reason='no requests')
def test():
    import requests
   ```

## Dead Ends

- **在模块顶层 try/except** — 尝试在导入时使用 try/except 并跳过，但 pytest 收集阶段可能报错 (50% fail)
- **条件逻辑错误** — 尝试使用 sys.modules 检查但条件写反 (40% fail)
