Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
Address some pylint violations
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Aug 27, 2021
1 parent 19a39b2 commit af8cd4e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 57 deletions.
44 changes: 1 addition & 43 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,11 @@
disable =
# Disabled on purpose
wrong-import-order, # managed by isort
line-too-long, # managed by black
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
abstract-method,
arguments-differ,
bad-continuation,
broad-except,
consider-merging-isinstance,
consider-using-in,
dangerous-default-value,
duplicate-code,
fixme,
implicit-str-concat,
import-error,
import-outside-toplevel,
inconsistent-return-statements,
invalid-name,
line-too-long,
logging-format-interpolation,
logging-not-lazy,
misplaced-comparison-constant,
missing-function-docstring,
missing-module-docstring,
no-else-raise,
no-else-return,
no-member,
no-self-argument,
no-self-use,
no-value-for-parameter,
not-callable,
protected-access,
raise-missing-from,
redefined-builtin,
redefined-outer-name,
subprocess-run-check,
super-init-not-called,
super-with-arguments,
too-few-public-methods,
too-many-ancestors,
too-many-arguments,
too-many-public-methods,
unidiomatic-typecheck,
unnecessary-comprehension,
unnecessary-lambda,
unused-argument,
unused-import,
unused-variable,
useless-object-inheritance,
useless-super-delegation,

[REPORTS]
output-format = colorized
Expand Down
4 changes: 2 additions & 2 deletions src/molecule_podman/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Podman(Driver):

def __init__(self, config=None):
"""Construct Podman."""
super(Podman, self).__init__(config)
super().__init__(config)
self._name = "podman"
# To change the podman executable, set environment variable
# MOLECULE_PODMAN_EXECUTABLE
Expand Down Expand Up @@ -205,7 +205,7 @@ def ansible_connection_options(self, instance_name):
@cache
def sanity_checks(self):
"""Implement Podman driver sanity checks."""
log.info("Sanity checks: '{}'".format(self._name))
log.info("Sanity checks: '%s'", self._name)
# TODO(ssbarnea): reuse ansible runtime instance from molecule once it
# fully adopts ansible-compat
runtime = Runtime()
Expand Down
4 changes: 0 additions & 4 deletions src/molecule_podman/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
"""Driver tests."""

# TODO(ssbarnea): Use introspection to guess driver name

DRIVER = "podman"
3 changes: 1 addition & 2 deletions src/molecule_podman/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import platform

import pytest
from molecule.test.conftest import random_string, temp_dir # noqa


def pytest_collection_finish(session):
Expand All @@ -15,6 +14,6 @@ def pytest_collection_finish(session):


@pytest.fixture
def DRIVER():
def driver_name() -> str:
"""Return name of the driver to be tested."""
return "podman"
6 changes: 2 additions & 4 deletions src/molecule_podman/test/test_driver.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""Unit tests."""
from molecule import api

# from . import DRIVER


def test_driver_is_detected(DRIVER):
def test_driver_is_detected():
"""Asserts that molecule recognizes the driver."""
assert DRIVER in [str(d) for d in api.drivers()]
assert any(str(d) == "podman" for d in api.drivers())
4 changes: 2 additions & 2 deletions src/molecule_podman/test/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def format_result(result: subprocess.CompletedProcess):
)


def test_command_init_scenario(tmp_path: pathlib.Path, DRIVER):
def test_command_init_scenario(tmp_path: pathlib.Path):
"""Verify that init scenario works."""
scenario_name = "default"

Expand All @@ -33,7 +33,7 @@ def test_command_init_scenario(tmp_path: pathlib.Path, DRIVER):
"scenario",
scenario_name,
"--driver-name",
DRIVER,
"podman",
]
result = run_command(cmd)
assert result.returncode == 0
Expand Down

0 comments on commit af8cd4e

Please sign in to comment.