Skip to content

Commit 95ccabb

Browse files
authored
Fixed pylint issues (#32)
1 parent 374c307 commit 95ccabb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

eric-oss-hello-world-python-app/login.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ def tls_login(url, headers):
5151
cert = (app_cert, app_key)
5252

5353
try:
54-
with open(client_id_path, "r") as f:
54+
with open(client_id_path, "r", encoding="utf-8") as f:
5555
form_data["client_id"] = f.read().strip()
5656
except OSError as e:
57-
raise LoginError(f"Error while reading client id: {e}")
57+
raise LoginError(f"Error while reading client id: {e}") from e
5858

5959
try:
6060
response = requests.post(

eric-oss-hello-world-python-app/tests/test_login.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
from login import login, LoginError
55
import pytest
66

7+
78
def test_login_receives_token_x509(mock_login_api, config):
9+
# pylint: disable=unused-argument
810
"""Check if we receive a token"""
911
token, expiry = login()
1012
assert token == "2YotnFZFEjr1zCsicMWpAA" and expiry > time.time()

eric-oss-hello-world-python-app/tests/test_mtls_logging.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests which cover the app's logging, both to STDOUT and to Log Aggregator"""
22

3-
import builtins
43
import json
54
from unittest import mock
65
import requests

0 commit comments

Comments
 (0)