diff --git a/.drone.jsonnet b/.drone.jsonnet index e4477a1..fc1fe75 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -13,6 +13,28 @@ local PipelineLinting = { 'ansible-later', ], }, + { + name: 'python-format', + image: 'python:3.9', + environment: { + PY_COLORS: 1, + }, + commands: [ + 'pip install -qq yapf', + 'yapf -dr ./', + ], + }, + { + name: 'python-flake8', + image: 'python:3.9', + environment: { + PY_COLORS: 1, + }, + commands: [ + 'pip install -qq flake8', + 'flake8', + ], + }, ], trigger: { ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], diff --git a/.drone.yml b/.drone.yml index 4ae5a22..19da0c6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,6 +12,22 @@ steps: commands: - ansible-later +- name: python-format + image: python:3.9 + commands: + - pip install -qq yapf + - yapf -dr ./ + environment: + PY_COLORS: 1 + +- name: python-flake8 + image: python:3.9 + commands: + - pip install -qq flake8 + - flake8 + environment: + PY_COLORS: 1 + trigger: ref: - refs/heads/master @@ -164,6 +180,6 @@ depends_on: --- kind: signature -hmac: 8a72390af54ec5b6a4625f5f8b81e6d5f2a8d9d1878222825c4564ff539b51cb +hmac: 43cb7291e54b484ae79b1ce4552d7ff1f9195dec6a9758b4f14444b2c223d1b1 ... diff --git a/molecule/centos7/tests/test_default.py b/molecule/centos7/tests/test_default.py index e9f7535..026ded9 100644 --- a/molecule/centos7/tests/test_default.py +++ b/molecule/centos7/tests/test_default.py @@ -2,13 +2,9 @@ import os import testinfra.utils.ansible_runner -import warnings - -warnings.filterwarnings("ignore", category=DeprecationWarning) - testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE'] -).get_hosts('all') + os.environ["MOLECULE_INVENTORY_FILE"] +).get_hosts("all") def test_cacerts_requirements(host): diff --git a/molecule/centos8/tests/test_default.py b/molecule/centos8/tests/test_default.py index e9f7535..026ded9 100644 --- a/molecule/centos8/tests/test_default.py +++ b/molecule/centos8/tests/test_default.py @@ -2,13 +2,9 @@ import os import testinfra.utils.ansible_runner -import warnings - -warnings.filterwarnings("ignore", category=DeprecationWarning) - testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE'] -).get_hosts('all') + os.environ["MOLECULE_INVENTORY_FILE"] +).get_hosts("all") def test_cacerts_requirements(host):