Skip to content

Commit

Permalink
Fix for new Prospector version
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner authored and renovate[bot] committed Oct 8, 2024
1 parent ce6fb92 commit 6238bb8
Show file tree
Hide file tree
Showing 18 changed files with 228 additions and 57 deletions.
21 changes: 13 additions & 8 deletions acceptance_tests/.prospector.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
---
max-line-length: 110
inherits:
- utils:base
- utils:no-design-checks
- utils:fix
- duplicated

pylint:
disable:
- wrong-import-order
- no-else-return
- broad-except
- unused-argument
- missing-timeout # Default timeout set by c2cwsgiutils
- missing-timeout # Done by c2cwsgiutils

mccabe:
mypy:
run: false

bandit:
run: false

pyroma:
run: false
4 changes: 3 additions & 1 deletion acceptance_tests/acceptance/file/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def composition(request):
"""
Fixture that will wait that the composition is started, used for all the tests.
"""
del request
for slave in ("api",):
path = os.path.join("/config", slave)
os.makedirs(path, exist_ok=True)
Expand All @@ -20,8 +21,9 @@ def composition(request):


@pytest.fixture
def app_connection(composition):
def app_connection(composition): # pylint: disable=redefined-outer-name
"""
Fixture that returns a connection to a running batch container.
"""
del composition
return Connection(base_url="http://api_file:8080/scm/", origin="http://example.com/")
4 changes: 3 additions & 1 deletion acceptance_tests/acceptance/inline/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def composition(request):
"""
Fixture that will wait that the composition is started, used for all the tests.
"""
del request
for slave in ("api",):
path = os.path.join("/config", slave)
os.makedirs(path, exist_ok=True)
Expand All @@ -20,8 +21,9 @@ def composition(request):


@pytest.fixture
def app_connection(composition):
def app_connection(composition): # pylint: disable=redefined-outer-name
"""
Fixture that returns a connection to a running batch container.
"""
del composition
return Connection(base_url="http://api_inline:8080/scm/", origin="http://example.com/")
4 changes: 3 additions & 1 deletion acceptance_tests/acceptance/normal/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def composition(request):
"""
Fixture that will wait that the composition is started, used for all the tests.
"""
del request
for slave in ("api", "slave", "slave-others"):
path = os.path.join("/config", slave)
os.makedirs(path, exist_ok=True)
Expand All @@ -55,8 +56,9 @@ def composition(request):


@pytest.fixture
def app_connection(composition: None):
def app_connection(composition: None): # pylint: disable=redefined-outer-name
"""
Fixture that returns a connection to a running batch container.
"""
del composition
return Connection(base_url="http://api:8080/scm/", origin="http://example.com/")
2 changes: 1 addition & 1 deletion acceptance_tests/acceptance/normal/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def git_source(app_connection: Connection):
assert not os.path.exists(os.path.join("/config", slave, "other"))


def test_ok(app_connection, git_source):
def test_ok(app_connection, git_source): # pylint: disable=redefined-outer-name
time.sleep(0.1)

for slave in ("api", "slave"):
Expand Down
26 changes: 24 additions & 2 deletions acceptance_tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions acceptance_tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ authors = []
python = ">=3.9,<3.11"
pytest-cov = "5.0.0"
prospector = "1.12.0"
prospector-profile-duplicated = "1.6.0"
prospector-profile-utils = "1.8.0"
typing-extensions = "4.12.2"
c2cwsgiutils = { version = "6.0.8", extras = ["standard", "test_images"] }
requests = "2.32.3"
Expand Down
3 changes: 3 additions & 0 deletions app/.bandit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
skips:
- B101 # Use of assert detected. The enclosed code will be removed when compiling to optimized byte code.
- B113 # Call to requests without timeout
33 changes: 9 additions & 24 deletions app/.prospector.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
---
strictness: veryhigh

max-line-length: 110
inherits:
- utils:base
- utils:no-design-checks
- utils:fix
- duplicated

pylint:
disable:
- too-many-locals
- too-many-branches
- too-many-arguments
- too-many-instance-attributes
- too-many-statements
- too-few-public-methods
- wrong-import-order
- no-else-return
- broad-except
- raising-format-tuple
- missing-timeout # Default timeout set by c2cwsgiutils

pyflakes:
disable:
- F401 # imported but unused, done by pylint

mccabe:
run: false
- missing-timeout # Done by c2cwsgiutils

mypy:
run: true
bandit:
options:
config: .bandit.yaml
Loading

0 comments on commit 6238bb8

Please sign in to comment.