diff --git a/bin/tests_n_reports.sh b/bin/tests_n_reports.sh index e28cd102..6aaf8403 100755 --- a/bin/tests_n_reports.sh +++ b/bin/tests_n_reports.sh @@ -5,5 +5,5 @@ set -e echo 'Running tests....' coverage run -m pytest -echo 'Running report....' -coverage report -m +echo 'Generating report....' +coverage xml diff --git a/sonar-project.properties b/sonar-project.properties index b1128c45..b31dc3ec 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,6 @@ sonar.projectKey=cb-devrel-carbon-black-cloud-sdk-python +sonar.python.coverage.reportPaths=coverage.xml + # Define the same root directory for sources and tests sonar.sources = src/ sonar.tests = src/ diff --git a/src/cbc_sdk/cache/lru.py b/src/cbc_sdk/cache/lru.py index ab2d5f0b..35f3744c 100644 --- a/src/cbc_sdk/cache/lru.py +++ b/src/cbc_sdk/cache/lru.py @@ -64,8 +64,6 @@ def withlock(self, *args, **kwargs): return func(self, *args, **kwargs) else: return func(self, *args, **kwargs) - - withlock.__name__ == func.__name__ return withlock @@ -137,11 +135,6 @@ def __init__(self, cache, peek_duration=60): cache (LRUCacheDict): The cache to be monitored. peek_duration (int): The delay between "sweeps" of the cache. """ - me = self - - def kill_self(o): - me - self.ref = weakref.ref(cache) self.peek_duration = peek_duration super(LRUCacheDict.EmptyCacheThread, self).__init__()