# TypeError: skipIf() argument 1 must be bool, not str

- **ID:** `python/unittest-skipif-condition-error`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The @unittest.skipIf decorator received a string condition instead of a boolean expression, often due to missing call or wrong syntax.

## Version Compatibility

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

## Workarounds

1. **Ensure the condition is a boolean expression, not a string.** (90% success)
   ```
   @unittest.skipIf(sys.version_info < (3, 9), 'Requires Python 3.9+')
   ```
2. **Use skipUnless for inverse logic if condition is complex.** (85% success)
   ```
   @unittest.skipUnless(hasattr(module, 'function'), 'Module missing function')
   ```

## Dead Ends

- **Using skipIf with a string literal like 'True'** — String 'True' is not a boolean; it will always evaluate to True (truthy) but cause TypeError. (80% fail)
- **Wrapping the condition in quotes to avoid syntax errors** — Quotes make it a string, which is not accepted by skipIf. (75% fail)
