Skip to content

Commit

Permalink
add real_http
Browse files Browse the repository at this point in the history
  • Loading branch information
grizz committed Jan 5, 2018
1 parent 5dce3ca commit c3ec69a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytest_filedata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ class RequestsData(object):
"""
class to use test data from requests
"""
def __init__(self, prefix):
def __init__(self, prefix, real_http=True):
self.prefix = prefix
adapter = requests_mock.Adapter()
adapter.register_uri(requests_mock.ANY, requests_mock.ANY, text=self.callback)
self.mocker = requests_mock.Mocker(adapter=adapter)
self.mocker = requests_mock.Mocker(adapter=adapter, real_http=real_http)

def callback(self, request, context):
path = urlparse.urlparse(request.url).path
Expand Down

0 comments on commit c3ec69a

Please sign in to comment.