From cf1ca5d85374ada71209591c454f3ba2777316cb Mon Sep 17 00:00:00 2001 From: Uman Shahzad Date: Fri, 6 Nov 2020 11:58:35 +0500 Subject: [PATCH] skip batch tests without token. the token is required to make batch reqs --- tests/handler_async_test.py | 2 ++ tests/handler_test.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/handler_async_test.py b/tests/handler_async_test.py index 22fd585..9f43efd 100644 --- a/tests/handler_async_test.py +++ b/tests/handler_async_test.py @@ -88,6 +88,8 @@ async def test_get_details(n): @pytest.mark.asyncio async def test_get_batch_details(n): token = os.environ.get("IPINFO_TOKEN", "") + if not token: + pytest.skip("token required for batch tests") handler = AsyncHandler(token) ips = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] details = await handler.getBatchDetails(ips) diff --git a/tests/handler_test.py b/tests/handler_test.py index d771b77..9cd7936 100644 --- a/tests/handler_test.py +++ b/tests/handler_test.py @@ -82,6 +82,8 @@ def test_get_details(n): @pytest.mark.parametrize("n", range(5)) def test_get_batch_details(n): token = os.environ.get("IPINFO_TOKEN", "") + if not token: + pytest.skip("token required for batch tests") handler = Handler(token) ips = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] details = handler.getBatchDetails(ips)