From f173a9d65dd6b3f07232cb458029fc0549394633 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 2 Feb 2026 11:08:00 +0000 Subject: [PATCH 1/3] fix deprecation warnings --- tests/test_historical_prices.py | 9 --------- tests/test_historical_prices_flat.py | 4 ---- tests/test_integration.py | 6 +++--- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/tests/test_historical_prices.py b/tests/test_historical_prices.py index a9e87c0..8d098e9 100644 --- a/tests/test_historical_prices.py +++ b/tests/test_historical_prices.py @@ -53,7 +53,6 @@ def test_historical_prices_v3_datetime_happy(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -95,7 +94,6 @@ def test_historical_prices_v3_num_points_happy(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -126,7 +124,6 @@ def test_historical_prices_v3_num_points_bad_numpoints(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json={ "errorCode": "Unable to convert value=3.14159 to type= Integer int" @@ -151,7 +148,6 @@ def test_historical_prices_v3_num_points_bad_resolution(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -235,7 +231,6 @@ def test_historical_prices_by_epic_and_date_range_v1_happy(self): responses.add( responses.GET, re.compile("https://demo-api.ig.com/gateway/deal/prices/.+"), - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -273,7 +268,6 @@ def test_historical_prices_by_epic_and_date_range_happy(self): responses.add( responses.GET, re.compile("https://demo-api.ig.com/gateway/deal/prices/.+"), - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -376,7 +370,6 @@ def test_historical_prices_by_epic_and_num_points_happy(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP/DAY/10", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -426,7 +419,6 @@ def test_historical_prices_by_epic_and_num_points_bad_numpoints(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json={ "errorCode": "Unable to convert value=3.14159 to type= Integer int" @@ -448,7 +440,6 @@ def test_historical_prices_by_epic_and_num_points_bad_resolution(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json={}, status=200, diff --git a/tests/test_historical_prices_flat.py b/tests/test_historical_prices_flat.py index cd0fb7c..029105b 100644 --- a/tests/test_historical_prices_flat.py +++ b/tests/test_historical_prices_flat.py @@ -54,7 +54,6 @@ def test_historical_prices_v3_datetime_happy(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -97,7 +96,6 @@ def test_historical_prices_v3_num_points_happy(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, @@ -131,7 +129,6 @@ def test_historical_prices_v3_num_points_bad_numpoints(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json={ "errorCode": "Unable to convert value=3.14159 to type= Integer int" @@ -159,7 +156,6 @@ def test_historical_prices_v3_num_points_bad_resolution(self): responses.add( responses.GET, "https://demo-api.ig.com/gateway/deal/prices/MT.D.GC.Month2.IP", - match_querystring=False, headers={"CST": "abc123", "X-SECURITY-TOKEN": "xyz987"}, json=response_body, status=200, diff --git a/tests/test_integration.py b/tests/test_integration.py index a372404..483f4d7 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -460,7 +460,7 @@ def test_search_markets(self, ig_service: IGService): def test_fetch_historical_prices_by_epic_and_numpoints(self, ig_service: IGService): response = ig_service.fetch_historical_prices_by_epic_and_num_points( - "CS.D.EURUSD.MINI.IP", "H", 4 + "CS.D.EURUSD.MINI.IP", "h", 4 ) assert isinstance(response["allowance"], dict) assert isinstance(response["prices"], pd.DataFrame) @@ -470,7 +470,7 @@ def test_fetch_historical_prices_by_epic_and_numpoints_flat( self, ig_service: IGService ): response = ig_service.fetch_historical_prices_by_epic_and_num_points( - "CS.D.EURUSD.MINI.IP", "H", 4, format=ig_service.flat_prices + "CS.D.EURUSD.MINI.IP", "h", 4, format=ig_service.flat_prices ) assert isinstance(response["allowance"], dict) assert isinstance(response["prices"], pd.DataFrame) @@ -481,7 +481,7 @@ def test_fetch_historical_prices_by_epic_and_numpoints_mid( self, ig_service: IGService ): response = ig_service.fetch_historical_prices_by_epic_and_num_points( - "CS.D.EURUSD.MINI.IP", "H", 4, format=ig_service.mid_prices + "CS.D.EURUSD.MINI.IP", "h", 4, format=ig_service.mid_prices ) assert isinstance(response["allowance"], dict) assert isinstance(response["prices"], pd.DataFrame) From 7079f6c3ccdb0d831a19b858328a29b84e9cf2b2 Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 2 Feb 2026 11:08:24 +0000 Subject: [PATCH 2/3] disable navigation tests --- tests/test_integration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_integration.py b/tests/test_integration.py index 483f4d7..9e3bdca 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -81,6 +81,7 @@ def ig_service(request, retrying): ig_service.logout() +# TODO refactor for new navigation API @pytest.fixture() def top_level_nodes(ig_service: IGService): """test fixture gets the top level navigation nodes""" @@ -270,6 +271,7 @@ def test_create_session_bad_api_key(self, retrying): with pytest.raises(IGException): ig_service.create_session() + @pytest.mark.xfail(reason="Navigation API has been changed by IG") def test_fetch_top_level_navigation_nodes(self, top_level_nodes): assert isinstance(top_level_nodes, pd.DataFrame) @@ -402,6 +404,7 @@ def assert_sentiment(response): assert isinstance(short, float) assert long + short == 100.0 + @pytest.mark.xfail(reason="Navigation API has been changed by IG") def test_fetch_sub_nodes_by_node(self, ig_service: IGService, top_level_nodes): rand_index = randint(0, len(top_level_nodes) - 1) response = ig_service.fetch_sub_nodes_by_node(rand_index) From a1fba77cf99053924f23fdcc07e583a11fe6974b Mon Sep 17 00:00:00 2001 From: Andy Geach Date: Mon, 2 Feb 2026 11:08:58 +0000 Subject: [PATCH 3/3] drop python 3.9 --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 6b267d7..6ca19bc 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.10", "3.11", "3.12" ] steps: