Skip to content

Commit

Permalink
Merge pull request #75 from jacebrowning/walk-cwd
Browse files Browse the repository at this point in the history
Walk the filesystem in search of coverage reports
  • Loading branch information
jacebrowning committed Jun 5, 2021
2 parents 5c6fce4 + 87f8075 commit 4c2f50a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Revision History

## 4.2 (beta)

- Updated the CoveragePy plugin to walk the filesystem in search of `htmlcov/index.html`.

## 4.1 (2021-02-21)

- Updated CLI help text to suggest invoking by Poetry when appropriate.
Expand Down
9 changes: 5 additions & 4 deletions coveragespace/coverage.py
Expand Up @@ -116,11 +116,12 @@ def get_coverage(self, cwd):
return total

def get_report(self, cwd):
path = os.path.join(cwd, "htmlcov", "index.html")
for root, _, _ in os.walk(cwd):
path = os.path.join(root, "htmlcov", "index.html")

if os.path.isfile(path):
log.info("Found coverage report: %s", path)
return path
if os.path.isfile(path):
log.info("Found coverage report: %s", path)
return path

log.info("No coverage report found: %s", cwd)
return None
2 changes: 1 addition & 1 deletion docs/requirements.txt
@@ -1,2 +1,2 @@
mkdocs==1.1.2; python_version >= "3.5"
pygments==2.7.4; python_version >= "3.5"
pygments==2.9.0; python_version >= "3.5"
27 changes: 23 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]

name = "coveragespace"
version = "4.1"
version = "4.2b1"
description = "A place to track your code coverage metrics."

license = "MIT"
Expand Down Expand Up @@ -67,7 +67,7 @@ scripttest = "*"

# Documentation
mkdocs = "^1.0"
pygments = "*"
pygments = "^2.9"

# Tooling
pyinstaller = "*"
Expand Down

0 comments on commit 4c2f50a

Please sign in to comment.