diff --git a/ci/gitlab-ci-runner b/ci/gitlab-ci-runner index f511404..32f0e23 100755 --- a/ci/gitlab-ci-runner +++ b/ci/gitlab-ci-runner @@ -12,8 +12,15 @@ git clone https://salsa.debian.org/debian/britney2-tests.git britney2-tests if [ "x$1" = "x--with-coverage" ]; then PYTEST_COV_OPTIONS="--cov-branch --cov --cov-report=" BRITNEY=./ci/britney-coverage.sh + TEST_FLAGS= +else + TEST_FLAGS=nocodestyle fi + +export TEST_FLAGS + py.test-3 -v $PYTEST_COV_OPTIONS || err=$? + echo britney2-tests/bin/runtests "$BRITNEY" britney2-tests/t test-out || err=$? diff --git a/tests/test_pycodestyle.py b/tests/test_pycodestyle.py index 59038cd..25798e6 100644 --- a/tests/test_pycodestyle.py +++ b/tests/test_pycodestyle.py @@ -3,6 +3,12 @@ import unittest import pycodestyle +def should_skip_codestyle(): + if 'nocodestyle' in os.environ.get('TEST_FLAGS', ''): + return True + return False + + EXCEPTIONS_BY_FILE = { 'britney.py': 36, 'britney2/__init__.py': 2, @@ -47,6 +53,7 @@ def all_python_files(project_dir): class TestCodeFormat(unittest.TestCase): + @unittest.skipIf(should_skip_codestyle(), 'codestyle conformance skipped as requested') def test_conformance(self): """Test that we conform to PEP-8.""" project_dir = os.path.dirname(os.path.dirname(__file__))