Set timeout in invoke local context

Hi there. I’m setting up a dev environment for serverless AWS python. We make use of a loop that checks whether the lambda is close to timing out, and use the context.get_remaining_time_in_millis() as follows:

while context.get_remaining_time_in_millis() > 1000:

The default for remaining time is 6 seconds. I’d love to be able to edit this, better yet have it match the timeout I have listed in serverless.yml:

  consumer:
    handler: src/consumer.handler
    name: ${self:provider.stage}-${self:service}-consumer
    timeout: 30
    memorySize: 1028

Any assistance would be great!