diff --git a/setup.cfg b/setup.cfg index f3c946e2..28e706ca 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,7 +58,7 @@ dev = sphinx-server testing = pytest - ciso8601 + ciso8601~=2.1.3 pytest-mock pytest-socket pytz diff --git a/tests/conftest.py b/tests/conftest.py index 2f3ec3df..c105642f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -197,11 +197,17 @@ def do_it(hits_json=None, all_studies=False, active=False): stubber.add_response('list_hits', hits_json) if active: - results = (amt_services_wrapper.get_active_hits( - all_studies=all_studies)).data + response = amt_services_wrapper.get_active_hits( + all_studies=all_studies) + if not response.data: + raise response.execption + results = response.data else: - results = (amt_services_wrapper.get_all_hits( - all_studies=all_studies)).data + response = amt_services_wrapper.get_all_hits( + all_studies=all_studies) + if not response.data: + raise response.exception + results = response.data return results return do_it diff --git a/tests/test_amt.py b/tests/test_amt.py index 445d5de6..0097f919 100644 --- a/tests/test_amt.py +++ b/tests/test_amt.py @@ -71,7 +71,6 @@ def test_wrapper_hit_create_with_require_qualification(self, stubber, amt_servic 'HITId': 'ABC123' } }) - # import pytest; pytest.set_trace() response = amt_services_wrapper.create_hit(1, 0.01, 1, require_qualification_ids=[REQUIRE_QUAL_ID]) if not response.success: @@ -103,7 +102,6 @@ def test_wrapper_hit_create_with_multiple_require_qualifications(self, stubber, 'HITId': 'ABC123' } }) - # import pytest; pytest.set_trace() response = amt_services_wrapper.create_hit(1, 0.01, 1, require_qualification_ids=REQUIRE_QUAL_IDS) if not response.success: @@ -175,7 +173,6 @@ def test_wrapper_hit_create_with_block_qualification(self, stubber, amt_services 'HITId': 'ABC123' } }) - # import pytest; pytest.set_trace() response = amt_services_wrapper.create_hit(1, 0.01, 1, block_qualification_ids=[BLOCK_QUAL_ID]) if not response.success: @@ -212,7 +209,6 @@ def test_wrapper_hit_create_with_require_and_block_qualifications(self, stubber, 'HITId': 'ABC123' } }) - # import pytest; pytest.set_trace() response = amt_services_wrapper.create_hit(1, 0.01, 1, require_qualification_ids=[REQUIRE_QUAL_ID], block_qualification_ids=[BLOCK_QUAL_ID])