summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-04-04 16:01:46 -0400
committerKenny Woodson <kwoodson@redhat.com>2017-04-04 16:01:46 -0400
commit3e61acff1ba4bf7032ea23c8da4f626cbad9150e (patch)
tree5cd2e8ed82b423e129a72f43e07d2025d0ac173e /roles/lib_openshift/src
parent76be31cf7eeb633cbca6e77b8d5b976826ac0b4e (diff)
downloadopenshift-3e61acff1ba4bf7032ea23c8da4f626cbad9150e.tar.gz
openshift-3e61acff1ba4bf7032ea23c8da4f626cbad9150e.tar.bz2
openshift-3e61acff1ba4bf7032ea23c8da4f626cbad9150e.tar.xz
openshift-3e61acff1ba4bf7032ea23c8da4f626cbad9150e.zip
Removing test coverage for shared code.
Diffstat (limited to 'roles/lib_openshift/src')
-rwxr-xr-xroles/lib_openshift/src/generate.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/generate.py b/roles/lib_openshift/src/generate.py
index 3f23455b5..2570f51dd 100755
--- a/roles/lib_openshift/src/generate.py
+++ b/roles/lib_openshift/src/generate.py
@@ -5,12 +5,16 @@
import argparse
import os
+import re
import yaml
import six
OPENSHIFT_ANSIBLE_PATH = os.path.dirname(os.path.realpath(__file__))
OPENSHIFT_ANSIBLE_SOURCES_PATH = os.path.join(OPENSHIFT_ANSIBLE_PATH, 'sources.yml') # noqa: E501
LIBRARY = os.path.join(OPENSHIFT_ANSIBLE_PATH, '..', 'library/')
+SKIP_COVERAGE_PATTERN = [re.compile('class Yedit.*$'),
+ re.compile('class Utils.*$')]
+PRAGMA_STRING = ' # pragma: no cover'
class GenerateAnsibleException(Exception):
@@ -72,6 +76,11 @@ def generate(parts):
if idx in [0, 1] and 'flake8: noqa' in line or 'pylint: skip-file' in line: # noqa: E501
continue
+ for skip in SKIP_COVERAGE_PATTERN:
+ if re.match(skip, line):
+ line = line.strip()
+ line += PRAGMA_STRING + os.linesep
+
data.write(line)
fragment_banner(fpart, "footer", data)