diff --git a/tests/requirements.txt b/tests/requirements.txt index 85e808d18..5833985cc 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -PyYAML==5.4.1 +PyYAML==6.0 requests==2.26.0 forcediphttpsadapter==1.0.2 kubernetes==20.11.0a1 diff --git a/tests/suite/test_v_s_route_focused_canary.py b/tests/suite/test_v_s_route_focused_canary.py index 55a777890..9f41a6c13 100644 --- a/tests/suite/test_v_s_route_focused_canary.py +++ b/tests/suite/test_v_s_route_focused_canary.py @@ -2,6 +2,7 @@ import requests import yaml +from yaml.loader import Loader from settings import TEST_DATA from suite.vs_vsr_resources_utils import create_virtual_server_from_yaml, create_v_s_route_from_yaml from suite.fixtures import VirtualServerRoute @@ -19,7 +20,7 @@ def get_weights_of_splitting(file) -> []: """ weights = [] with open(file) as f: - docs = yaml.load_all(f) + docs = yaml.load_all(f, Loader=Loader) for dep in docs: for item in dep['spec']['subroutes'][0]['matches'][0]['splits']: weights.append(item['weight']) @@ -35,7 +36,7 @@ def get_upstreams_of_splitting(file) -> []: """ upstreams = [] with open(file) as f: - docs = yaml.load_all(f) + docs = yaml.load_all(f, Loader=Loader) for dep in docs: for item in dep['spec']['subroutes'][0]['matches'][0]['splits']: upstreams.append(item['action']['pass']) diff --git a/tests/suite/test_v_s_route_split_traffic.py b/tests/suite/test_v_s_route_split_traffic.py index 9d15eba79..fa009c5da 100644 --- a/tests/suite/test_v_s_route_split_traffic.py +++ b/tests/suite/test_v_s_route_split_traffic.py @@ -1,3 +1,4 @@ +from yaml.loader import Loader import pytest import requests import yaml @@ -16,7 +17,7 @@ def get_weights_of_splitting(file) -> []: """ weights = [] with open(file) as f: - docs = yaml.load_all(f) + docs = yaml.load_all(f, Loader=Loader) for dep in docs: for item in dep['spec']['subroutes'][0]['splits']: weights.append(item['weight']) @@ -32,7 +33,7 @@ def get_upstreams_of_splitting(file) -> []: """ upstreams = [] with open(file) as f: - docs = yaml.load_all(f) + docs = yaml.load_all(f, Loader=Loader) for dep in docs: for item in dep['spec']['subroutes'][0]['splits']: upstreams.append(item['action']['pass'])