# unittest.suite.TestSuite: No tests found in 'tests/' directory

- **ID:** `python/unittest-testloader-discover-empty`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The unittest test discovery process did not find any test files matching the default pattern (test*.py) in the specified directory, possibly because test files are named differently or the directory path is incorrect.

## Version Compatibility

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

## Workarounds

1. **Specify a custom test discovery pattern using the -p option** (90% success)
   ```
   python -m unittest discover -s tests/ -p '*_test.py'
This will find files ending with '_test.py'.
   ```
2. **Ensure the test directory path is correct and test files follow the default pattern** (85% success)
   ```
   Check that tests/ exists and contains files like test_example.py. If not, move or rename files accordingly.
Alternatively, use: python -m unittest discover -s ./tests
   ```

## Dead Ends

- **Renaming all test files to start with 'test_' without checking the pattern** — This may work but ignores the possibility of custom patterns or incorrect directory paths. (50% fail)
- **Running tests with a different command like `python -m pytest tests/` without adjusting unittest settings** — This switches to pytest, which may not be the intended framework and could require separate configuration. (60% fail)
