Skip to content

Commit 672eeb8

Browse files
PetrHeinzclaude
andcommitted
tests: drop dead pre-3.10 version guards
With the minimum supported version now Python 3.10, the `version_info` early-return in test_frame and the `skipIf(sys.version_info < (3, 8))` guard in test_flusher are always false/never-skip. Remove them and the now-unused `sys` / `version_info` imports. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 079722f commit 672eeb8

2 files changed

Lines changed: 0 additions & 7 deletions

File tree

tests/test_flusher.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# coding: utf-8
22
from __future__ import print_function, unicode_literals
33
import mock
4-
import sys
54
import time
65
import threading
76
import unittest
@@ -179,8 +178,6 @@ def uploader(frame):
179178
self.assertEqual(self.upload_calls, 1)
180179
self.assertFalse(fw.should_run)
181180

182-
# test relies on overriding excepthook which is available from 3.8+
183-
@unittest.skipIf(sys.version_info < (3, 8), "Test skipped because overriding excepthook is only available on Python 3.8+")
184181
def test_shutdown_dont_raise_exception_in_thread(self):
185182
original_excepthook = threading.excepthook
186183
threading.excepthook = mock.Mock()

tests/test_frame.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from logtail.frame import create_frame
44
from logtail.handler import LogtailHandler
55
from logtail.helpers import LogtailContext
6-
from sys import version_info
76
import datetime
87
import unittest
98
import logging
@@ -17,9 +16,6 @@ def test_create_frame_happy_path(self):
1716
# ISO timestamp must end with timezone info
1817
self.assertTrue(frame['dt'].endswith("+00:00"))
1918

20-
# These tests require Python >= 3.7
21-
if version_info.major == 2 or version_info.minor <= 6:
22-
return
2319
# Sent date matches log record date
2420
date_ref = datetime.datetime.utcfromtimestamp(log_record.created).replace(tzinfo=datetime.timezone.utc)
2521
date_sent = datetime.datetime.fromisoformat(frame['dt'])

0 commit comments

Comments
 (0)