@@ -238,7 +238,9 @@ def bar(self, arg):
238
238
assert foo .bar (arg = 10 ) == 20
239
239
assert other .bar (arg = 10 ) == 20
240
240
foo .bar .assert_called_once_with (arg = 10 )
241
+ assert foo .bar .return_value == 20
241
242
spy .assert_called_once_with (arg = 10 )
243
+ assert spy .return_value == 20
242
244
243
245
244
246
@skip_pypy
@@ -272,6 +274,7 @@ class Foo(Base):
272
274
assert other .bar (arg = 10 ) == 20
273
275
calls = [mocker .call (foo , arg = 10 ), mocker .call (other , arg = 10 )]
274
276
assert spy .call_args_list == calls
277
+ assert spy .return_value == 20
275
278
276
279
277
280
@skip_pypy
@@ -284,7 +287,9 @@ def bar(cls, arg):
284
287
spy = mocker .spy (Foo , "bar" )
285
288
assert Foo .bar (arg = 10 ) == 20
286
289
Foo .bar .assert_called_once_with (arg = 10 )
290
+ assert Foo .bar .return_value == 20
287
291
spy .assert_called_once_with (arg = 10 )
292
+ assert spy .return_value == 20
288
293
289
294
290
295
@skip_pypy
@@ -301,7 +306,9 @@ class Foo(Base):
301
306
spy = mocker .spy (Foo , "bar" )
302
307
assert Foo .bar (arg = 10 ) == 20
303
308
Foo .bar .assert_called_once_with (arg = 10 )
309
+ assert Foo .bar .return_value == 20
304
310
spy .assert_called_once_with (arg = 10 )
311
+ assert spy .return_value == 20
305
312
306
313
307
314
@skip_pypy
@@ -320,7 +327,9 @@ def bar(cls, arg):
320
327
spy = mocker .spy (Foo , "bar" )
321
328
assert Foo .bar (arg = 10 ) == 20
322
329
Foo .bar .assert_called_once_with (arg = 10 )
330
+ assert Foo .bar .return_value == 20
323
331
spy .assert_called_once_with (arg = 10 )
332
+ assert spy .return_value == 20
324
333
325
334
326
335
@skip_pypy
@@ -333,7 +342,9 @@ def bar(arg):
333
342
spy = mocker .spy (Foo , "bar" )
334
343
assert Foo .bar (arg = 10 ) == 20
335
344
Foo .bar .assert_called_once_with (arg = 10 )
345
+ assert Foo .bar .return_value == 20
336
346
spy .assert_called_once_with (arg = 10 )
347
+ assert spy .return_value == 20
337
348
338
349
339
350
@skip_pypy
@@ -350,7 +361,9 @@ class Foo(Base):
350
361
spy = mocker .spy (Foo , "bar" )
351
362
assert Foo .bar (arg = 10 ) == 20
352
363
Foo .bar .assert_called_once_with (arg = 10 )
364
+ assert Foo .bar .return_value == 20
353
365
spy .assert_called_once_with (arg = 10 )
366
+ assert spy .return_value == 20
354
367
355
368
356
369
@contextmanager
0 commit comments