From 69f3f807078babccd64fb9c2814099e4feb3cb02 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Thu, 16 Mar 2023 23:09:07 +0100 Subject: [PATCH] follow standard formatting for python tests --- molecule/default/tests/test_default.py | 1 + molecule/with_custom_repo/tests/conftest.py | 3 +++ molecule/with_custom_repo/tests/test_default.py | 1 + 3 files changed, 5 insertions(+) diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index 2507cac..2f48c0d 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -1,5 +1,6 @@ """Role testing files using testinfra.""" + def test_hosts_file(host): """Validate /etc/hosts file.""" etc_hosts = host.file("/etc/hosts") diff --git a/molecule/with_custom_repo/tests/conftest.py b/molecule/with_custom_repo/tests/conftest.py index 2d9f0c0..f7ddb3f 100644 --- a/molecule/with_custom_repo/tests/conftest.py +++ b/molecule/with_custom_repo/tests/conftest.py @@ -1,8 +1,11 @@ """PyTest Fixtures.""" from __future__ import absolute_import + import os + import pytest + def pytest_runtest_setup(item): """Run tests only when under molecule with testinfra installed.""" try: diff --git a/molecule/with_custom_repo/tests/test_default.py b/molecule/with_custom_repo/tests/test_default.py index 206e9e7..fa629ef 100644 --- a/molecule/with_custom_repo/tests/test_default.py +++ b/molecule/with_custom_repo/tests/test_default.py @@ -1,5 +1,6 @@ """Role testing files using testinfra.""" + def test_hosts_file(host): """Validate /etc/hosts file.""" etc_hosts = host.file("/etc/hosts")