# Failed: [pytest] filterwarnings error in '...': DeprecationWarning: datetime.datetime.utcnow() is deprecated

- **ID:** `python/pytest-warning-as-error-failed`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The project configures filterwarnings = error, turning warnings into failures. A third-party library or the code under test emits a DeprecationWarning that is not in the ignore list.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   [tool.pytest.ini_options]
filterwarnings = [
  "error",
  "ignore:datetime.datetime.utcnow:DeprecationWarning",
  "ignore:.*is deprecated:DeprecationWarning:thirdparty.module",
]
   ```
2. **** (95% success)
   ```
   # before:
from datetime import datetime
datetime.utcnow()

# after:
from datetime import datetime, timezone
datetime.now(timezone.utc)
   ```

## Dead Ends

- **** — Reintroduces noisy warnings and hides genuine deprecations you wanted to catch. (40% fail)
- **** — Not applied in CI where the config is used; local passes but CI fails. (70% fail)
