Skip to content

Commit 5baba65

Browse files
committed
Fix linter errors
1 parent 52e1daf commit 5baba65

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

dynatrace_extension/sdk/callback.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def get_next_execution_timestamp(self) -> float:
149149
"""
150150
Get the timestamp for the next execution of the callback
151151
This is done using execution total, the interval and the start timestamp
152-
:return: datetime
152+
:return: float
153153
"""
154154
return self.start_timestamp_monotonic + self.interval.total_seconds() * (self.iterations or 1)
155-

dynatrace_extension/sdk/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ def _parse_args(self):
778778
parser.add_argument("--secrets", required=False, default="secrets.json")
779779
parser.add_argument("--no-print-metrics", required=False, action="store_true")
780780

781-
args, unknown = parser.parse_known_args()
781+
args, _ = parser.parse_known_args()
782782
self._is_fastcheck = args.fastcheck
783783
if args.dsid is None:
784784
# DEV mode

tests/sdk/test_extension.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import threading
22
import time
33
import unittest
4-
from datetime import datetime, timedelta
4+
from datetime import timedelta
55
from unittest.mock import MagicMock, mock_open, patch
66

77
import pytest
@@ -387,15 +387,15 @@ def test_fastcheck_exception(self):
387387
extension._client = MagicMock()
388388

389389
fastcheck = MagicMock()
390-
fastcheck.side_effect = Exception("SomeException")
390+
fastcheck.side_effect = ImportError("SomeException")
391391
extension.register_fastcheck(fastcheck)
392-
self.assertRaises(Exception, extension._run_fastcheck)
392+
self.assertRaises(ImportError, extension._run_fastcheck)
393393

394394
fastcheck.assert_called_once()
395395
extension._client.send_status.assert_called_once()
396396
self.assertEqual(extension._client.send_status.call_args[0][0].status, StatusValue.GENERIC_ERROR)
397397
self.assertIn(
398-
"Python datasource fastcheck error: Exception('SomeException')",
398+
"Python datasource fastcheck error: ImportError('SomeException')",
399399
extension._client.send_status.call_args[0][0].message,
400400
)
401401

0 commit comments

Comments
 (0)