Skip to content

Commit

Permalink
Fix pytest-cov crash (#1390)
Browse files Browse the repository at this point in the history
The `pytest-cov` plugin is used to gather test coverage info, using the
`coverage` tool.
It suffers from a limitation where child processes created by tests do
not inherit the `coverage` configuration from `pyproject.toml` because
that file is not on the command line.
This limitation is described here
nedbat/coveragepy#512
With the introduction of LSP, we started encountering crashes when
collecting coverage data, because LSP launches a child process.
The solution is to move `coverage` configuration into a dedicated
`.coveragerc` file.

This PR does just that.

Fixes #1363

Co-authored-by: Guenia Izquierdo Delgado <[email protected]>
  • Loading branch information
ericvergnaud and gueniai authored Jan 2, 2025
1 parent 66b5ad0 commit 53e54f2
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,6 @@ ban-relative-imports = "all"
"ARG001" # tests may not use the provided fixtures
]

[tool.coverage.run]
branch = true
parallel = true

[tool.coverage.report]
omit = ["src/databricks/labs/remorph/coverage/*",
"src/databricks/labs/remorph/helpers/execution_time.py",
"__about__.py"]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"def main()",
]

[tool.pylint.main]
# PyLint configuration is adapted from Google Python Style Guide with modifications.
# Sources https://google.github.io/styleguide/pylintrc
Expand Down

0 comments on commit 53e54f2

Please sign in to comment.