Skip to content

relative_files & include broken since 7.0 #1604

Closed
@ikonst

Description

@ikonst

Describe the bug

  1. Create simple test case with relative_files = true

    mkdir foo
    echo 'print()" > foo/bar.py
    echo "[run]\nrelative_files = true" > .coveragerc
  2. coverage run foo/bar.py

  3. coverage report --include=foo/bar.py

Expected (as behavior was before 7.0):

Name         Stmts   Miss  Cover
--------------------------------
foo/bar.py       1      0   100%
--------------------------------
TOTAL            1      0   100%

Actual:

No data to report

Additional analysis:

It appears that the regex created from the foo/bar.py glob pattern includes the current working directory, which might explain why it wouldn't match against relative paths anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions