Skip to content

Commit 10a31be

Browse files
authored
chore(pymongo): update pymongo test (#10810)
Update pymongo test to account for module changes in `Server` with the new release of `4.9.x` ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has 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) --------- Co-authored-by: quinna-h <[email protected]>
1 parent 73fdc23 commit 10a31be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/contrib/pymongo/test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
from ..config import MONGO_CONFIG
1919

2020

21+
if pymongo.version_tuple >= (4, 9):
22+
from pymongo.synchronous.server import Server
23+
else:
24+
from pymongo.server import Server
25+
26+
2127
def test_normalize_filter():
2228
# ensure we can properly normalize queries FIXME[matt] move to the agent
2329
cases = [
@@ -713,7 +719,7 @@ def setUp(self):
713719
super(TestPymongoSocketTracing, self).setUp()
714720
patch()
715721
# Override server pin's tracer with our dummy tracer
716-
Pin.override(pymongo.server.Server, tracer=self.tracer)
722+
Pin.override(Server, tracer=self.tracer)
717723
# maxPoolSize controls the number of sockets that the client can instantiate
718724
# and choose from to perform classic operations. For the sake of our tests,
719725
# let's limit this number to 1

0 commit comments

Comments
 (0)