Skip to content

Commit

Permalink
Simplify the call_args mock lookup #185
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Jun 7, 2021
1 parent be85c4b commit ddb6fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scanpipe/tests/test_pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,12 @@ def noop(*args, **kwargs):

with mock.patch("scanpipe.pipes.scancode.SCANCODEIO_PROCESSES", -1):
scancode._scan_and_save(project1, scan_func, noop)
with_threading = scan_func.call_args_list[-1].args[-1]
with_threading = scan_func.call_args.args[-1]
self.assertFalse(with_threading)

with mock.patch("scanpipe.pipes.scancode.SCANCODEIO_PROCESSES", 0):
scancode._scan_and_save(project1, scan_func, noop)
with_threading = scan_func.call_args_list[-1].args[-1]
with_threading = scan_func.call_args.args[-1]
self.assertTrue(with_threading)

def test_scanpipe_pipes_scancode_virtual_codebase(self):
Expand Down

0 comments on commit ddb6fef

Please # to comment.