Pyrefly cannot find common test module
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
Given the following folder hierarchy:
```
my_package/
`- __init__.py
tests/
+- common.py
`- test_my_package.py
pyproject.toml
```
If `test_my_package.py` tries to `import common`, running `pyrefly check` gives the following error:
```
ERROR Cannot find module `common` [missing-import]
--> tests/test_my_package.py:1:8
|
1 | import common
| ^^^^^^
|
Looked in these locations (from default config for project root marked by `/home/user/my_package/pyproject.toml`):
Import root (inferred from project layout): "/home/user/my_package"
Site package path queried from interpreter: ["/home/user/my_package/.venv/lib/python3.11/site-packages", "/home/user/my_package"]
```
Note that `pytest` is able to find the `common` module and runs fine.
### Versions
- OS: Linux
- Python: 3.11.2
- Pyrefly: 0.55.0
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.