Skip to content

Commit aafb154

Browse files
Jonathas-Conceicaootavio
authored andcommitted
tox: Update dependencies and fix new lints and warnings
Signed-off-by: Jonathas-Conceicao <[email protected]>
1 parent a2ce73e commit aafb154

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
junit_family=xunit1
3+
filterwarnings = ignore:.*pep8.*

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tox]
2-
envlist = py35, py36
2+
envlist = py35, py36, py37, py38
33

44
[testenv]
55
deps =
6-
pylint==1.7.*
7-
pytest==2.9.1
8-
pytest-cov==2.2.1
9-
pytest-pep8==1.0.6
6+
pylint==2.*
7+
pytest==5.*
8+
pytest-cov==2.*
9+
pytest-pep8==1.*
1010
commands =
1111
py.test \
1212
--cov={envsitepackagesdir}/updatehub \

updatehub/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import json
1919

2020

21-
class Api(object):
21+
class Api:
2222
"""
2323
Api class used to access the agent API. Must be executed on the host that
2424
is running the agent.

updatehub/listener.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import io
99
import os
10+
import sys
1011
import socket
1112
import threading
1213

13-
1414
from enum import Enum
1515
from enum import unique
1616

@@ -57,7 +57,7 @@ class State(Enum):
5757
ERROR = "error"
5858

5959

60-
class StateCommand(object):
60+
class StateCommand:
6161
"""
6262
A command class whose objects can be used to send commands back to the
6363
agent.
@@ -107,17 +107,15 @@ class MalformedState(Exception):
107107
Exception class raised on errors of the communication protocol on the
108108
socket.
109109
"""
110-
pass
111110

112111

113112
class StateError(Exception):
114113
"""
115114
Exception class raised when receiving errors from the agent execution.
116115
"""
117-
pass
118116

119117

120-
class StateChangeListener(object):
118+
class StateChangeListener:
121119
"""
122120
Listener class for the agent. Objects from this class monitor a Unix socket
123121
that will receive data from the agent, and triggers registered callbacks
@@ -210,7 +208,7 @@ def start(self):
210208
"""
211209
if not os.path.isfile(StateChangeListener.SDK_TRIGGER_FILENAME):
212210
print("updatehub-sdk-statechange-trigger not found!")
213-
exit(1)
211+
sys.exit()
214212

215213
self.running = True
216214
self.thread.start()

0 commit comments

Comments
 (0)