@@ -44,21 +44,21 @@ def __init__(
44
44
), "batch_load_fn must be coroutine. Received: {}" .format (self .batch_load_fn )
45
45
46
46
if not callable (self .batch_load_fn ):
47
- raise TypeError (
47
+ raise TypeError ( # pragma: no cover
48
48
(
49
49
"DataLoader must be have a batch_load_fn which accepts "
50
50
"Iterable<key> and returns Future<Iterable<value>>, but got: {}."
51
51
).format (batch_load_fn )
52
52
)
53
53
54
54
if batch is not None :
55
- self .batch = batch
55
+ self .batch = batch # pragma: no cover
56
56
57
57
if max_batch_size is not None :
58
58
self .max_batch_size = max_batch_size
59
59
60
60
if cache is not None :
61
- self .cache = cache
61
+ self .cache = cache # pragma: no cover
62
62
63
63
self .get_cache_key = get_cache_key or (lambda x : x )
64
64
@@ -77,7 +77,7 @@ def load(self, key=None):
77
77
Loads a key, returning a `Future` for the value represented by that key.
78
78
"""
79
79
if key is None :
80
- raise TypeError (
80
+ raise TypeError ( # pragma: no cover
81
81
(
82
82
"The loader.load() function must be called with a value, "
83
83
"but got: {}."
@@ -113,7 +113,7 @@ def do_resolve_reject(self, key, future):
113
113
enqueue_post_future_job (self .loop , self )
114
114
else :
115
115
# Otherwise dispatch the (queue of one) immediately.
116
- dispatch_queue (self )
116
+ dispatch_queue (self ) # pragma: no cover
117
117
118
118
def load_many (self , keys ):
119
119
"""
@@ -129,7 +129,7 @@ def load_many(self, keys):
129
129
>>> )
130
130
"""
131
131
if not isinstance (keys , Iterable ):
132
- raise TypeError (
132
+ raise TypeError ( # pragma: no cover
133
133
(
134
134
"The loader.load_many() function must be called with Iterable<key> "
135
135
"but got: {}."
@@ -223,7 +223,7 @@ async def dispatch_queue_batch(loader, queue):
223
223
224
224
# Assert the expected response from batch_load_fn
225
225
if not batch_future or not iscoroutine (batch_future ):
226
- return failed_dispatch (
226
+ return failed_dispatch ( # pragma: no cover
227
227
loader ,
228
228
queue ,
229
229
TypeError (
@@ -238,7 +238,7 @@ async def dispatch_queue_batch(loader, queue):
238
238
try :
239
239
values = await batch_future
240
240
if not isinstance (values , Iterable ):
241
- raise TypeError (
241
+ raise TypeError ( # pragma: no cover
242
242
(
243
243
"DataLoader must be constructed with a function which accepts "
244
244
"Iterable<key> and returns Future<Iterable<value>>, but the function did "
@@ -248,7 +248,7 @@ async def dispatch_queue_batch(loader, queue):
248
248
249
249
values = list (values )
250
250
if len (values ) != len (keys ):
251
- raise TypeError (
251
+ raise TypeError ( # pragma: no cover
252
252
(
253
253
"DataLoader must be constructed with a function which accepts "
254
254
"Iterable<key> and returns Future<Iterable<value>>, but the function did "
0 commit comments