Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
multiprocessing_stop,
args=(coverage_object,),
exitpriority=1000
)
if COVERAGE_AVAILABLE:
multiprocessing.util.register_after_fork(
multiprocessing_start,
multiprocessing_start
)
except ImportError:
pass
if COVERAGE_AVAILABLE:
# Cover any processes if the environ variables are present
coverage.process_startup()
class SaltCoverageTestingParser(SaltTestingParser):
'''
Code coverage aware testing option parser
'''
def __init__(self, *args, **kwargs):
if kwargs.pop('html_output_from_env', None) is not None or \
kwargs.pop('html_output_dir', None) is not None:
warnings.warn(
'The unit tests HTML support was removed from {0}. Please '
'stop passing \'html_output_dir\' or \'html_output_from_env\' '
'as arguments to {0}'.format(self.__class__.__name__),
category=DeprecationWarning,
stacklevel=2
)
from __future__ import with_statement
from .tools import chdir
import unittest
import sys, os
try:
import coverage
coverage.process_startup()
except ImportError:
pass
if 'fast' in sys.argv:
sys.stderr.write("Warning: The 'fast' keyword skipps server tests.\n")
os.environ["TEST_FAST"] = "true"
import bottle
bottle.debug(True)
def start_coverage():
COV.start()
coverage.process_startup()
# Ensure coverage starts for all Python processes so that test coverage is calculated
# properly when using subprocesses (see https://coverage.readthedocs.io/en/latest/subprocess.html)
import coverage
print("Starting coverage from sitecustomize")
coverage.process_startup()
def main():
import os
if os.getenv("TRAVIS", None) or os.getenv("FORCE_COVERAGE", None):
# Enable coverage if it is Travis-CI or env variable FORCE_COVERAGE set to true
import coverage
coverage.process_startup()
cli = Cli()
cli.parse_args()
print(cli.run())
def _initCoverage():
if 'COVERAGE_PROCESS_START' in os.environ:
try:
import coverage
coverage.process_startup()
except ImportError:
pass
def patched_execlp(*args):
from coverage import process_startup
process_startup.coverage.save()
orig(*args)