Skip to content

Commit 59a171c

Browse files
committed
Fix tests for old Pythons
1 parent 00fdd77 commit 59a171c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/scanpy/_compat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import warnings
66
from dataclasses import dataclass, field
7-
from functools import cache, partial, wraps
7+
from functools import WRAPPER_ASSIGNMENTS, cache, partial, wraps
88
from importlib.util import find_spec
99
from pathlib import Path
1010
from typing import TYPE_CHECKING, Literal, ParamSpec, TypeVar, cast, overload
@@ -230,7 +230,8 @@ def _delegate(cls) -> None:
230230
continue
231231

232232
def mk_wrapper(name: str):
233-
@wraps(meth)
233+
# Old pytest versions try to run the doctests
234+
@wraps(meth, assigned=set(WRAPPER_ASSIGNMENTS) - {"__doc__"})
234235
def wrapper(self: _FakeRandomGen, *args, **kwargs):
235236
return getattr(self._state, name)(*args, **kwargs)
236237

0 commit comments

Comments
 (0)