Page MenuHomeSoftware Heritage
Paste P446

Multiple context managers
ActivePublic

Authored by twitu on Jun 22 2019, 9:50 AM.
with (
patch('swh.web.common.service.idx_storage') as mock_idx_storage,
patch('swh.web.common.service.storage' as mock_storage
):

Event Timeline

twitu created this object in space S1 Public.

flake8 gives syntax error on first as

This comment was removed by twitu.
with patch('swh.web.common.service.idx_storage') as mock_idx_storage,
             patch('swh.web.common.service.storage') as mock_storage:

giving sytax error on mock_idx_storage

with patch('swh.web.common.service.idx_storage') as mock_idx_storage, \
             patch('swh.web.common.service.storage') as mock_storage:

Adding backslash solves it