From a4c9653652591072b23d33008b2b3d88d8ec0e43 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Wed, 25 Oct 2023 03:23:47 -0400 Subject: [PATCH] feat: pytest-cov (#96) * fix: attribute error case for unnamed wrapped fn * feat: pytest-cov --- .coverage | Bin 0 -> 53248 bytes a_sync/modified.py | 3 ++- requirements-dev.txt | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .coverage diff --git a/.coverage b/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..29dad6565bf5df09648041f50f8346060bd4c13a GIT binary patch literal 53248 zcmeI43ve678G!F}vQ8)IZsn)^*4gnR2FI_^0tqBI#B@?p!XpW7Nm0)7*;Xv+jP8`g zLxU|sOG^tK(g)>Hl6Iz)R~d#Gm?;yI%s|tDNnj{24W%V*2_>av0z-kcPU`-2p9;r<1!}LFGB&BB zdP*IP#dS579Ee3VE0!EmtzkW%I&JC$^g##L;88~tb})S!i^K*%%hHD+i_ugpp{2&u z5q+$kCCHU#>6@+W1;|8?4JBy`b$(90O-<>8dP+}5bu(+l{MbO7uWjqNPYjio@;B?O zPFgAo|NS#+0~ZQaSuqG1MUB(|wZ1>4C8NW-*{*8SHH;cy=VmKg+mw;$v)+Tv_7kuE6YZwpnM9=T=JaqAQ+c4@>mOs zv}jOfHYd}Gen7qo)%NX!d(T=a=#v^h$lRd0iadw<22FGT3Y}8ZQklvBI zo1GRu?T!Rpr(5!b`ognyo#`$R>7I`IGF2WiR8zy>D6wvoYpq-$&geq!r&PBW#(Jh9`%lS-pM9_JOeu`#P zf?g>MffF7C&dndytYP(J+v#O6ytT*^T3kMx;najkHw5^McN+G72ep0e&qpFIV8vl$f5^Xws2 z8%qwu`*OoHWAIp|k1cai{;JwKteJEcGF#Pt!-(rzGW%=*jTI)888cO8!^uyjrG-4q zF`CEF##Uxi{^3HW`PDG!^5Y94iG-FM$UU#p{D%>8t5(sHts2q>zpFeptJq9^2; z&op=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YhwwE(x0Z;`FAKfoBVU_HPFqLcOH8nTvL z0c!%jK$byvcpw2JfCP{L5;idxiRFDN16?Fgq{{kAV$+iFh literal 0 HcmV?d00001 diff --git a/a_sync/modified.py b/a_sync/modified.py index d75018af..cae939d1 100644 --- a/a_sync/modified.py +++ b/a_sync/modified.py @@ -31,8 +31,9 @@ def __init__(self, fn: SyncFn[P, T], **modifiers: Unpack[ModifierKwargs]) -> Non def __init__(self, fn: AnyFn[P, T], **modifiers: Unpack[ModifierKwargs]) -> None: _helpers._validate_wrapped_fn(fn) self.modifiers = ModifierManager(**modifiers) - self.__name__ = fn.__name__ self.__wrapped__ = fn + if hasattr(self.__wrapped__, '__name__'): + self.__name__ = self.__wrapped__.__name__ @overload def __call__(self, *args: P.args, sync: Literal[True] = True, **kwargs: P.kwargs) -> T:... diff --git a/requirements-dev.txt b/requirements-dev.txt index 56f6258a..ae6d248d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1 +1,2 @@ -pytest-asyncio-cooperative \ No newline at end of file +pytest-asyncio-cooperative +pytest-cov \ No newline at end of file