Skip to content

Commit

Permalink
blacklist fidoclient instead
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-dowdell committed Mar 27, 2020
1 parent 6f424af commit 0c0d475
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bravado/testing/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from bravado.exception import HTTPMovedPermanently
from bravado.http_client import HttpClient
from bravado.http_future import FutureAdapter
from bravado.requests_client import RequestsClient
from bravado.swagger_model import Loader


Expand Down Expand Up @@ -495,10 +494,19 @@ def test_msgpack_support(self, swagger_http_server):
assert unpackb(response.raw_bytes, encoding='utf-8') == API_RESPONSE

def test_following_redirects(self, swagger_http_server):
# the FidoClient doesn't have a way to turn off redirects being followed
# so limit this test to the RequestsClient instead
if not isinstance(self.http_client, RequestsClient):
pytest.skip('Following redirects is only supported in the RequestsClient')
try:
# if running the default tests, the fido dependencies aren't loaded
# so rather than load dependencies unnecessarily, skip the test if that's not the case
# the coverage test incorrectly marks the exception handling as uncovered
# hence the pragma usage
from bravado.fido_client import FidoClient
except ImportError: # pragma: no cover
pytest.skip('Fido dependencies have not been loaded, skipping test') # pragma: no cover
else:
# the FidoClient doesn't have a way to turn off redirects being followed
# so limit this test to the RequestsClient instead
if isinstance(self.http_client, FidoClient):
pytest.skip('Following redirects is not supported in the FidoClient')

response = self.http_client.request({
'method': 'GET',
Expand Down

0 comments on commit 0c0d475

Please sign in to comment.