Accidentally discovered a new way to work with GitHub Copilot today: write new tests based off test coverage reports. Copilot (or I) run this command to generate a report of all the uncovered lines in the current diff: pytest --cov --cov-report=xml && \ diff-cover coverage.xml --html-report coverage_report.html && \ open coverage_report.html Then Copilot reviews the report, summarizes the uncovered situations, and proposes new test cases to add, or if the code is truly unreachable, suggests deleting it. Just another reason why you should add diff-cover (or similar tool) to your projects!
Copying...
Very useful
Great discovery, Pamela! Summarizing uncovered situations with Copilot is a very efficient approach. This kind of practical solution is exactly what we need more of in the industry. 🚀
Ex-Microsoft | Cloud, Security, AI, Data
2moLove this so much!