mirror of https://github.com/ansible/ansible.git
Move ansible-test unit coverage code into plugin.
parent
49a1ec40aa
commit
c79afb1cba
@ -1,22 +1,24 @@
|
|||||||
"""Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
|
"""Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
|
||||||
import gc
|
from __future__ import (absolute_import, division, print_function)
|
||||||
import os
|
|
||||||
|
|
||||||
try:
|
|
||||||
|
def pytest_configure():
|
||||||
|
try:
|
||||||
import coverage
|
import coverage
|
||||||
except ImportError:
|
except ImportError:
|
||||||
coverage = None
|
coverage = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
test = coverage.Coverage
|
test = coverage.Coverage
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
coverage = None
|
coverage = None
|
||||||
|
|
||||||
|
|
||||||
def pytest_configure():
|
|
||||||
if not coverage:
|
if not coverage:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
import gc
|
||||||
|
import os
|
||||||
|
|
||||||
coverage_instances = []
|
coverage_instances = []
|
||||||
|
|
||||||
for obj in gc.get_objects():
|
for obj in gc.get_objects():
|
Loading…
Reference in New Issue