Browse Source

Skip codestyle in stable

Testing this is sid is sufficient and avoids annoying cases where
pycodestyle might work differently in stable vs. sid.

Signed-off-by: Niels Thykier <niels@thykier.net>
devuan-deployment
Niels Thykier 1 year ago
parent
commit
22610d86a0
No known key found for this signature in database GPG Key ID: A65B78DBE67C7AAC
2 changed files with 14 additions and 0 deletions
  1. +7
    -0
      ci/gitlab-ci-runner
  2. +7
    -0
      tests/test_pycodestyle.py

+ 7
- 0
ci/gitlab-ci-runner View File

@@ -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=$?



+ 7
- 0
tests/test_pycodestyle.py View File

@@ -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__))


Loading…
Cancel
Save