File tree Expand file tree Collapse file tree 2 files changed +0
-8
lines changed Expand file tree Collapse file tree 2 files changed +0
-8
lines changed Original file line number Diff line number Diff line change 6
6
TYPE_CHECKING ,
7
7
Any ,
8
8
Callable ,
9
- Coroutine ,
10
9
Dict ,
11
10
Generic ,
12
11
Optional ,
@@ -129,11 +128,6 @@ async def aget_result(self, result_id: str) -> "TaskResult[T]":
129
128
130
129
return result
131
130
132
- def __call__ (
133
- self , * args : P .args , ** kwargs : P .kwargs
134
- ) -> Union [T , Coroutine [T , None , None ]]:
135
- return self .func (* args , ** kwargs )
136
-
137
131
def call (self , * args : P .args , ** kwargs : P .kwargs ) -> T :
138
132
if iscoroutinefunction (self .func ):
139
133
return async_to_sync (self .func )(* args , ** kwargs ) # type:ignore[no-any-return]
Original file line number Diff line number Diff line change @@ -134,14 +134,12 @@ async def test_invalid_priority(self) -> None:
134
134
await test_tasks .noop_task .using (priority = 0 ).aenqueue ()
135
135
136
136
def test_call_task (self ) -> None :
137
- self .assertEqual (test_tasks .calculate_meaning_of_life (), 42 )
138
137
self .assertEqual (test_tasks .calculate_meaning_of_life .call (), 42 )
139
138
140
139
async def test_call_task_async (self ) -> None :
141
140
self .assertEqual (await test_tasks .calculate_meaning_of_life .acall (), 42 )
142
141
143
142
async def test_call_async_task (self ) -> None :
144
- self .assertIsNone (await test_tasks .noop_task_async ()) # type:ignore[func-returns-value]
145
143
self .assertIsNone (await test_tasks .noop_task_async .acall ())
146
144
147
145
def test_call_async_task_sync (self ) -> None :
You can’t perform that action at this time.
0 commit comments