You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When this runs, the include and omit patterns get munged into an absolute path which is relative to the current working directory. This happens because the find_code_units() function in report.py calls file_locator.abs_file() for each pattern.
This is fine if the current working directory is /home/mark/someproject/. But it causes problems if the current working directory is /home/mark/someproject/tests/. In this case the pattern is munged to '/home/mark/someproject/tests/*.py', which won't match the source code for my project.
I can work around this by simply adding a slash to the beginning of my patterns. This changes the pattern to an absolute path and file_locator.abs_file() will not alter it.
I don't think I understand the reason for calling file_locator.abs_file() on the patterns in this case... maybe we could just remove that?
Originally reported by Mark Doliner (Bitbucket: markdoliner, GitHub: markdoliner)
Using the coverage api, say I pass in include or omit parameters that look like this:
or
When this runs, the include and omit patterns get munged into an absolute path which is relative to the current working directory. This happens because the find_code_units() function in report.py calls file_locator.abs_file() for each pattern.
This is fine if the current working directory is /home/mark/someproject/. But it causes problems if the current working directory is /home/mark/someproject/tests/. In this case the pattern is munged to '/home/mark/someproject/tests/*.py', which won't match the source code for my project.
I can work around this by simply adding a slash to the beginning of my patterns. This changes the pattern to an absolute path and file_locator.abs_file() will not alter it.
I don't think I understand the reason for calling file_locator.abs_file() on the patterns in this case... maybe we could just remove that?
The text was updated successfully, but these errors were encountered: