Skip to content

Commit c2ff971

Browse files
committed
PYTHON-5505 Use functools.wraps to fix test_comment
1 parent a83dea8 commit c2ff971

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

pymongo/asynchronous/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import asyncio
1919
import builtins
20+
import functools
2021
import random
2122
import socket
2223
import sys
@@ -41,6 +42,7 @@
4142

4243

4344
def _handle_reauth(func: F) -> F:
45+
@functools.wraps(func)
4446
async def inner(*args: Any, **kwargs: Any) -> Any:
4547
no_reauth = kwargs.pop("no_reauth", False)
4648
from pymongo.asynchronous.pool import AsyncConnection
@@ -88,6 +90,7 @@ async def _backoff(
8890

8991

9092
def _retry_overload(func: F) -> F:
93+
@functools.wraps(func)
9194
async def inner(*args: Any, **kwargs: Any) -> Any:
9295
no_retry = kwargs.pop("no_retry", False)
9396
attempt = 0

pymongo/synchronous/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import asyncio
1919
import builtins
20+
import functools
2021
import random
2122
import socket
2223
import sys
@@ -41,6 +42,7 @@
4142

4243

4344
def _handle_reauth(func: F) -> F:
45+
@functools.wraps(func)
4446
def inner(*args: Any, **kwargs: Any) -> Any:
4547
no_reauth = kwargs.pop("no_reauth", False)
4648
from pymongo.message import _BulkWriteContext
@@ -88,6 +90,7 @@ def _backoff(
8890

8991

9092
def _retry_overload(func: F) -> F:
93+
@functools.wraps(func)
9194
def inner(*args: Any, **kwargs: Any) -> Any:
9295
no_retry = kwargs.pop("no_retry", False)
9396
attempt = 0

test/asynchronous/test_backpressure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Test the CSOT unified spec tests."""
15+
"""Test Client Backpressure spec."""
1616
from __future__ import annotations
1717

1818
import sys
@@ -38,7 +38,7 @@
3838
}
3939

4040

41-
class TestCSOT(AsyncIntegrationTest):
41+
class TestBackpressure(AsyncIntegrationTest):
4242
RUN_ON_LOAD_BALANCER = True
4343

4444
@async_client_context.require_failCommand_appName

test/test_backpressure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Test the CSOT unified spec tests."""
15+
"""Test Client Backpressure spec."""
1616
from __future__ import annotations
1717

1818
import sys
@@ -38,7 +38,7 @@
3838
}
3939

4040

41-
class TestCSOT(IntegrationTest):
41+
class TestBackpressure(IntegrationTest):
4242
RUN_ON_LOAD_BALANCER = True
4343

4444
@client_context.require_failCommand_appName

0 commit comments

Comments
 (0)