Skip to content

Commit 90df364

Browse files
committed
tests: update tests to conform to pylint
Signed-off-by: George Pisaltu <[email protected]>
1 parent ccfa95c commit 90df364

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

tests/framework/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ApiTimeoutException(Exception):
1414

1515
def __init__(self, duration, method, resource, payload):
1616
"""Compose the error message from the API call components."""
17-
super(ApiTimeoutException, self).__init__(
17+
super().__init__(
1818
'API call exceeded maximum duration: {:.2f} ms.\n'
1919
'Call: {} {} {}'.format(duration, method, resource, payload)
2020
)

tests/framework/http.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Session(requests_unixsocket.Session):
1616

1717
def __init__(self):
1818
"""Create a Session object and set the is_good_response callback."""
19-
super(Session, self).__init__()
19+
super().__init__()
2020

2121
def is_good_response(response: int):
2222
"""Return `True` for all HTTP 2xx response codes."""
@@ -49,24 +49,24 @@ def get(self, url, **kwargs):
4949
"""Wrap the GET call with duration limit."""
5050
# pylint: disable=method-hidden
5151
# The `untime` method overrides this, and pylint disapproves.
52-
return super(Session, self).get(url, **kwargs)
52+
return super().get(url, **kwargs)
5353

5454
@decorators.timed_request
5555
def patch(self, url, data=None, **kwargs):
5656
"""Wrap the PATCH call with duration limit."""
5757
# pylint: disable=method-hidden
5858
# The `untime` method overrides this, and pylint disapproves.
59-
return super(Session, self).patch(url, data=data, **kwargs)
59+
return super().patch(url, data=data, **kwargs)
6060

6161
@decorators.timed_request
6262
def put(self, url, data=None, **kwargs):
6363
"""Wrap the PUT call with duration limit."""
6464
# pylint: disable=method-hidden
6565
# The `untime` method overrides this, and pylint disapproves.
66-
return super(Session, self).put(url, data=data, **kwargs)
66+
return super().put(url, data=data, **kwargs)
6767

6868
def untime(self):
6969
"""Restore the HTTP methods to their un-timed selves."""
70-
self.get = super(Session, self).get
71-
self.patch = super(Session, self).patch
72-
self.put = super(Session, self).put
70+
self.get = super().get
71+
self.patch = super().patch
72+
self.put = super().put

tests/framework/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class StoppableThread(threading.Thread):
2525

2626
def __init__(self, *args, **kwargs):
2727
"""Set up a Stoppable thread."""
28-
super(StoppableThread, self).__init__(*args, **kwargs)
28+
super().__init__(*args, **kwargs)
2929
self._should_stop = False
3030

3131
def stop(self):

tests/host_tools/cpu_load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CpuLoadExceededException(Exception):
1818

1919
def __init__(self, cpu_load_samples, threshold):
2020
"""Compose the error message containing the cpu load details."""
21-
super(CpuLoadExceededException, self).__init__(
21+
super().__init__(
2222
'Cpu load samples {} exceeded maximum threshold {}.\n'
2323
.format(cpu_load_samples, threshold)
2424
)

tests/host_tools/memory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class MemoryUsageExceededException(Exception):
1313

1414
def __init__(self, usage, threshold):
1515
"""Compose the error message containing the memory consumption."""
16-
super(MemoryUsageExceededException, self).__init__(
16+
super().__init__(
1717
'Memory usage ({} KiB) exceeded maximum threshold ({} KiB).\n'
1818
.format(usage, threshold)
1919
)

0 commit comments

Comments
 (0)