fix: future-import-boilerplate and metaclass-boilerplate

Signed-off-by: gardar <gardar@users.noreply.github.com>
This commit is contained in:
gardar 2023-01-11 19:50:51 +00:00
parent cac0f68ca2
commit 3227cf01ec
No known key found for this signature in database
GPG key ID: 00872BAF59D98753
13 changed files with 52 additions and 13 deletions

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,3 +1,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner

View file

@ -1,3 +1,6 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,7 +1,10 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import yaml
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@ -10,7 +13,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
@pytest.fixture()
def AnsibleDefaults():
with open("defaults/main.yml", 'r') as stream:
return yaml.load(stream)
return yaml.full_load(stream)
@pytest.mark.parametrize("dirs", [
@ -69,5 +72,5 @@ def test_socket(host):
def test_version(host, AnsibleDefaults):
version = os.getenv('PROMETHEUS', AnsibleDefaults['prometheus_version'])
run = host.run("/usr/local/bin/prometheus --version")
out = run.stdout+run.stderr
out = run.stdout + run.stderr
assert "prometheus, version " + version in out

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')

View file

@ -1,6 +1,9 @@
import pytest
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')