hatch icon indicating copy to clipboard operation
hatch copied to clipboard

CoverageWarning when running `hatch test` with the `--parallel` flag

Open cdwilson opened this issue 7 months ago • 0 comments

The auto-generated github workflow (test.yml) created by hatch new runs hatch test with the --parallel flag.

When the --parallel flag is included, I get a series of CoverageWarning on my local machine and also when running on GitHub Actions:

/Users/chris/Downloads/hatch-test-project/.hatch/hatch-test.py3.12/lib/python3.12/site-packages/coverage/inorout.py:503: CoverageWarning: Module hatch_test_project was never imported. (module-not-imported)
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/Users/chris/Downloads/hatch-test-project/.hatch/hatch-test.py3.12/lib/python3.12/site-packages/coverage/inorout.py:503: CoverageWarning: Module tests was never imported. (module-not-imported)
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/Users/chris/Downloads/hatch-test-project/.hatch/hatch-test.py3.12/lib/python3.12/site-packages/coverage/control.py:888: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")

How to reproduce

hatch new hatch-test-project
cd hatch-test-project/
hatch test --python 3.12 --cover --randomize --parallel --retries 2 --retry-delay 1

I found this issue which appears to be similar but was closed as completed.

cdwilson avatar Jul 23 '24 00:07 cdwilson