this test should only apply to changes which modifies code. for the doc
only changes, we should skip this test for lowering the bar for
contributors willing to improve the document.
Signed-off-by: Kefu Chai <kchai@redhat.com>
--- /dev/null
+import pytest
+
+
+def pytest_configure(config):
+ config.addinivalue_line(
+ "markers", "code_test: mark test to run against code related changes"
+ )
+
+
+def pytest_addoption(parser):
+ parser.addoption("--skip-code-test", action="store_true",
+ help="skip code tests")
+
+
+def pytest_runtest_setup(item):
+ if "code_test" in item.keywords and item.config.getoption("--skip-code-test"):
+ pytest.skip("skipping due to --skip-code-test")
'git fetch origin +refs/heads/{target_branch}:refs/remotes/origin/{target_branch}'.format(
target_branch=cls.target_branch))
+ @pytest.mark.code_test
def test_signed_off_by(self):
signed_off_regex = r'Signed-off-by: \S.* <[^@]+@[^@]+\.[^@]+>'
# '-z' puts a '\0' between commits, see later split('\0')