rednafi / fastapi-nano

🐍 Simple FastAPI template that mimics Flask's blueprint directory structure
MIT License
893 stars 95 forks source link

WARNING: Failed to generate report: No data to report. #315

Closed priamai closed 1 week ago

priamai commented 2 weeks ago

Hello, when I run make test:

tests/test_apis.py::test_api_a_unauthorized FAILED                                                                      [  6%]/home/robomotic/DevOps/github/fastapi-nano/.venv/lib/python3.13/site-packages/coverage/inorout.py:505: CoverageWarning: Module src was never imported. (module-not-imported)
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/home/robomotic/DevOps/github/fastapi-nano/.venv/lib/python3.13/site-packages/coverage/control.py:892: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")
WARNING: Failed to generate report: No data to report.

can you explain what should be done to generate a proper coverage report? How do we enable the data collection?

rednafi commented 2 weeks ago

Interesting, the make test command doesn’t have coverage anywhere. What command are you running to get this?

rednafi commented 2 weeks ago

Do you have uv installed and configured properly? The CI runs make test and it works without any error. So I couldn’t reproduce it.

priamai commented 2 weeks ago

Yes fresh git clone with UV installed and I get that error. Very weird.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Redowan Delowar @.> Sent: Wednesday, October 23, 2024 7:19:26 PM To: rednafi/fastapi-nano @.> Cc: Paolo Di Prodi @.>; Author @.> Subject: Re: [rednafi/fastapi-nano] WARNING: Failed to generate report: No data to report. (Issue #315)

Do you have uv installed and configured properly? The CI runs make test and it works without any error. So I couldn’t reproduce it.

— Reply to this email directly, view it on GitHubhttps://github.com/rednafi/fastapi-nano/issues/315#issuecomment-2433067897, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANVNMBRODZ3ASG2EB4RIWR3Z47SC5AVCNFSM6AAAAABQMQ4W7WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZTGA3DOOBZG4. You are receiving this because you authored the thread.Message ID: @.***>

rednafi commented 1 week ago

I was able to reproduce it. This has been patched. Thanks for reporting.

https://github.com/rednafi/fastapi-nano/pull/316