Skip to content

Commit 26d15fe

Browse files
atombrellaphilpep
authored andcommitted
Use super() Python 3 syntax. Don't explicitly inherit object.
1 parent 8b08424 commit 26d15fe

31 files changed

+44
-45
lines changed

testinfra/backend/ansible.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, host, ansible_inventory=None, ssh_config=None,
3131
self.ssh_config = ssh_config
3232
self.ssh_identity_file = ssh_identity_file
3333
self.force_ansible = force_ansible
34-
super(AnsibleBackend, self).__init__(host, *args, **kwargs)
34+
super().__init__(host, *args, **kwargs)
3535

3636
@property
3737
def ansible_runner(self):

testinfra/backend/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
'HostSpec', ['name', 'port', 'user', 'password'])
2424

2525

26-
class CommandResult(object):
26+
class CommandResult:
2727

2828
def __init__(
2929
self, backend, exit_status, command, stdout_bytes,
@@ -36,7 +36,7 @@ def __init__(
3636
self._stderr = stderr
3737
self.command = command
3838
self._backend = backend
39-
super(CommandResult, self).__init__()
39+
super().__init__()
4040

4141
@property
4242
def succeeded(self):
@@ -101,7 +101,7 @@ def __repr__(self):
101101
)
102102

103103

104-
class BaseBackend(object):
104+
class BaseBackend:
105105
"""Represent the connection to the remote or local system"""
106106
NAME = None
107107
HAS_RUN_SALT = False
@@ -113,7 +113,7 @@ def __init__(self, hostname, sudo=False, sudo_user=None, *args, **kwargs):
113113
self.hostname = hostname
114114
self.sudo = sudo
115115
self.sudo_user = sudo_user
116-
super(BaseBackend, self).__init__()
116+
super().__init__()
117117

118118
def set_host(self, host):
119119
self._host = host

testinfra/backend/docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DockerBackend(base.BaseBackend):
1818

1919
def __init__(self, name, *args, **kwargs):
2020
self.name, self.user = self.parse_containerspec(name)
21-
super(DockerBackend, self).__init__(self.name, *args, **kwargs)
21+
super().__init__(self.name, *args, **kwargs)
2222

2323
def run(self, command, *args, **kwargs):
2424
cmd = self.get_command(command, *args)

testinfra/backend/kubectl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, name, *args, **kwargs):
2121
self.container = kwargs.get('container')
2222
self.namespace = kwargs.get('namespace')
2323
self.kubeconfig = kwargs.get('kubeconfig')
24-
super(KubectlBackend, self).__init__(self.name, *args, **kwargs)
24+
super().__init__(self.name, *args, **kwargs)
2525

2626
def run(self, command, *args, **kwargs):
2727
cmd = self.get_command(command, *args)

testinfra/backend/local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class LocalBackend(base.BaseBackend):
1717
NAME = "local"
1818

1919
def __init__(self, *args, **kwargs):
20-
super(LocalBackend, self).__init__("local", **kwargs)
20+
super().__init__("local", **kwargs)
2121

2222
def get_pytest_id(self):
2323
return "local"

testinfra/backend/lxc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LxcBackend(base.BaseBackend):
1818

1919
def __init__(self, name, *args, **kwargs):
2020
self.name = name
21-
super(LxcBackend, self).__init__(self.name, *args, **kwargs)
21+
super().__init__(self.name, *args, **kwargs)
2222

2323
def run(self, command, *args, **kwargs):
2424
cmd = self.get_command(command, *args)

testinfra/backend/openshift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, name, *args, **kwargs):
2121
self.container = kwargs.get('container')
2222
self.namespace = kwargs.get('namespace')
2323
self.kubeconfig = kwargs.get('kubeconfig')
24-
super(OpenShiftBackend, self).__init__(self.name, *args, **kwargs)
24+
super().__init__(self.name, *args, **kwargs)
2525

2626
def run(self, command, *args, **kwargs):
2727
cmd = self.get_command(command, *args)

testinfra/backend/paramiko.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(
4242
self.ssh_identity_file = ssh_identity_file
4343
self.get_pty = False
4444
self.timeout = int(timeout)
45-
super(ParamikoBackend, self).__init__(self.host.name, *args, **kwargs)
45+
super().__init__(self.host.name, *args, **kwargs)
4646

4747
def _load_ssh_config(self, client, cfg, ssh_config):
4848
for key, value in ssh_config.lookup(self.host.name).items():

testinfra/backend/podman.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class PodmanBackend(base.BaseBackend):
1818

1919
def __init__(self, name, *args, **kwargs):
2020
self.name, self.user = self.parse_containerspec(name)
21-
super(PodmanBackend, self).__init__(self.name, *args, **kwargs)
21+
super().__init__(self.name, *args, **kwargs)
2222

2323
def run(self, command, *args, **kwargs):
2424
cmd = self.get_command(command, *args)

testinfra/backend/salt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SaltBackend(base.BaseBackend):
2626
def __init__(self, host, *args, **kwargs):
2727
self.host = host
2828
self._client = None
29-
super(SaltBackend, self).__init__(self.host, *args, **kwargs)
29+
super().__init__(self.host, *args, **kwargs)
3030

3131
@property
3232
def client(self):
@@ -62,4 +62,4 @@ def get_hosts(cls, host, **kwargs):
6262
if not hosts:
6363
raise RuntimeError("No host matching '%s'" % (host,))
6464
return sorted(hosts)
65-
return super(SaltBackend, cls).get_hosts(host, **kwargs)
65+
return super().get_hosts(host, **kwargs)

0 commit comments

Comments
 (0)