_get_name_from_path() in Lib/unittest/loader.py fails when src path contains symlinks
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
This is conceptually somewhat similar to gh-148314
When the path to the source tree is via a symlink, an alternate path to the same will cause _get_name_from_path() to assert, thinking the supplied path is not a sub-path of the src tree. During the run of unittest's test suite, "." is passed as a path which is resolved to an absolute path - which of course doesn't match a symlinked path.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
- gh-149143
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Lib/unittest/loader.py at _get_name_from_path(), then run the unittest test suite using a source-tree path reached through a symlink. Done means the alternate path no longer triggers the sub-path assertion and the relevant regression coverage passes; gh-149143 is already linked to this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100