Skip to content

Commit

Permalink
Fix tests for old Pythons
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Nov 21, 2024
1 parent 00fdd77 commit 59a171c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scanpy/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import warnings
from dataclasses import dataclass, field
from functools import cache, partial, wraps
from functools import WRAPPER_ASSIGNMENTS, cache, partial, wraps
from importlib.util import find_spec
from pathlib import Path
from typing import TYPE_CHECKING, Literal, ParamSpec, TypeVar, cast, overload
Expand Down Expand Up @@ -230,7 +230,8 @@ def _delegate(cls) -> None:
continue

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

Expand Down

0 comments on commit 59a171c

Please sign in to comment.