Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

coverage_filter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coverage_filter

Coverage filter

pipPyPI
Version
0.0.0
Maintainers
1

Coverage filter

Allows developers to indicate which code they are trying to test when using coverage tools.

Warning This is just a proof of concept. The API will likely change as I receive feedback. There are also no unit tests, or other code quality control methods in place. If you wish to use this code, please make a copy for yourself, so my changes won't break your build.

Example

Example code to be tested: (in target.py)

.. code-block::

def target(self):
    return target_inner()

def target_inner(self):
    return 42

Example unit test: (in test_target.py)

.. code-block::

from coverage_filter import CoverageFilter
from target import target

@CoverageFilter('target.py:target')
def test_target(self):   
    assert target() == 42

For more information, check out my blog on the topic.

Keywords

unit test coverage

FAQs

Did you know?

Socket

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.

Install

Related posts