|
|
@ -24,8 +24,16 @@ def pytest_configure():
|
|
|
|
coverage_instances.append(obj)
|
|
|
|
coverage_instances.append(obj)
|
|
|
|
|
|
|
|
|
|
|
|
if not coverage_instances:
|
|
|
|
if not coverage_instances:
|
|
|
|
|
|
|
|
coverage_config = os.environ.get('_ANSIBLE_COVERAGE_CONFIG')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not coverage_config:
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cov = coverage.Coverage(config_file=coverage_config)
|
|
|
|
|
|
|
|
coverage_instances.append(cov)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
cov = None
|
|
|
|
|
|
|
|
|
|
|
|
os_exit = os._exit
|
|
|
|
os_exit = os._exit
|
|
|
|
|
|
|
|
|
|
|
|
def coverage_exit(*args, **kwargs):
|
|
|
|
def coverage_exit(*args, **kwargs):
|
|
|
@ -36,3 +44,6 @@ def pytest_configure():
|
|
|
|
os_exit(*args, **kwargs)
|
|
|
|
os_exit(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
os._exit = coverage_exit
|
|
|
|
os._exit = coverage_exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if cov:
|
|
|
|
|
|
|
|
cov.start()
|
|
|
|