# ImportError while importing test module: /path/to/test_foo.py
Hint: Make sure your test modules/packages have valid Python names.

- **ID:** `python/pytest-collection-error-import-error`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The test file has a syntax error, imports a missing module, or has a naming conflict.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Run python -m py_compile test_foo.py to check syntax.
   ```
2. **** (95% success)
   ```
   Rename the file to test_foo.py if it's not already.
   ```

## Dead Ends

- **** — If the issue is a syntax error or missing import, renaming won't help. (50% fail)
- **** — This may cause further import issues. (60% fail)
