FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Generate implicit aliases for nested relative paths by JSap0914 · Pull Request #2233 · coveragepy/coveragepy · GitHub

Generate implicit aliases for nested relative paths - #2233

Open
JSap0914 wants to merge 1 commit into
coveragepy:mainfrom
JSap0914:fix/path-alias-relative-suffix-2195
Open

Generate implicit aliases for nested relative paths#2233
JSap0914 wants to merge 1 commit into
coveragepy:mainfrom
JSap0914:fix/path-alias-relative-suffix-2195

Conversation

Copy link
Copy Markdown
Contributor

What changed

  • Generate implicit relative-path aliases for every directory component instead of only the first component.
  • Add a regression test for a combined path whose usable local source is a deeper existing suffix.

Why

With relative_files = true, the first relative filename seen during combine could generate an alias such as */work -> work/. If that target did not exist locally, the path stayed unchanged even when a deeper suffix such as src/pkg/module.py did exist. Because input file ordering can vary, this produced intermittent No source for code errors.

Fixes #2195

Tests

  • python -m pytest tests/test_files.py::PathAliasesTest::test_implicit_relative_path_uses_existing_suffix -q
  • python -m pytest tests/test_files.py -q
  • tox -q -e py313 (C tracer: 1592 passed; Python tracer: 1561 passed; sys.monitoring: 1542 passed)
  • tox -q -e lint
  • tox -q -e mypy
  • pre-commit run --files coverage/files.py tests/test_files.py

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random/flaky "No source for code" errors

1 participant


Back | FazBrowse Home | New Git URL