Skip to content

Commit 715c182

Browse files
authored
ci(redis): fix python<3.7 support (#7057)
Reverts the following commit: 80ff6f3. Fixes the failing v1.20.2 build action: https://github.com/DataDog/dd-trace-py/actions/runs/6314357914/job/17150041391. ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [ ] Title is accurate. - [ ] No unnecessary changes are introduced. - [ ] Description motivates each change. - [ ] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [ ] Testing strategy adequately addresses listed risk(s). - [ ] Change is maintainable (easy to change, telemetry, documentation). - [ ] Release note makes sense to a user of the library. - [ ] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [ ] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [ ] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [ ] This PR doesn't touch any of that.
1 parent 1a1c7ef commit 715c182

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ddtrace/internal/compat.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
PY2 = sys.version_info[0] == 2
4747
PY3 = sys.version_info[0] == 3
4848

49-
try:
50-
from unittest import mock
51-
except ImportError:
52-
import mock # type: ignore # noqa
5349

5450
try:
5551
from builtin import TimeoutError

tests/contrib/redis/test_redis.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
88
from ddtrace.contrib.redis.patch import patch
99
from ddtrace.contrib.redis.patch import unpatch
10-
from ddtrace.internal.compat import mock
1110
from ddtrace.internal.schema import DEFAULT_SPAN_SERVICE_NAME
1211
from tests.opentracer.utils import init_tracer
1312
from tests.utils import DummyTracer
@@ -17,6 +16,12 @@
1716
from ..config import REDIS_CONFIG
1817

1918

19+
try:
20+
from unittest import mock
21+
except ImportError:
22+
import mock # type: ignore # noqa
23+
24+
2025
class TestRedisPatch(TracerTestCase):
2126

2227
TEST_PORT = REDIS_CONFIG["port"]

0 commit comments

Comments
 (0)