Skip to content

Commit

Permalink
Stop using mocker in with.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe committed Oct 7, 2021
1 parent bc7b2e4 commit 41a7cd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import datetime
import json
import platform
import tempfile
import uuid
from collections import OrderedDict
Expand Down Expand Up @@ -606,9 +607,9 @@ def test_handles_failed_platform_call(

def fail():
raise RuntimeError
mocker.patch('platform.platform', side_effect=fail)

with mocker.patch("platform.platform", side_effect=fail):
requestor.request("get", self.valid_path, {}, {})
requestor.request("get", self.valid_path, {}, {})

check_call("get", headers=APIHeaderMatcher(fail_platform_call=True))

Expand Down

0 comments on commit 41a7cd0

Please # to comment.