
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Creates a set of all lines that have no test coverage in the current git diff
Run missing_diff_lines()
after you ran coverage.py
in a git-repo, e.g. with coverage run -m unittest discover
.
It will output a set with tuples in the form (filename, line-number)
for every line in the current diff, that has no test that
covers it.
Say you have this code in calc.py
and no tests yet:
def mul(a, b):
return a * b
You add some more cod:
def mul(a, b):
return a * b
def div(a, b):
if b == 0:
return 0
return a / b
As well as a test-suite:
class TestDiv(TestCase):
def test_simple_div(self):
self.assertEqual(3, div(9, 3))
Note, that the branch b == 0
is not covered.
And indeed. if you run:
$ coverage run -m unittest discover && python3 report.py
Where this is the content of report.py
:
from missing_diff_lines import missing_diff_lines
from pprint import pprint
print(missing_diff_lines())
You get
{('calc.py', 6)}
Which is correct, as this line is not covered. But note, that the not covered line 2 is not in the current diff and thus is not reported. This is the very purpose of this package.
FAQs
Creates a set of all lines that have no test coverage in the current git diff
We found that missing-diff-lines demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.