diff --git a/changelogs/fragments/test_ansibleundefined.yaml b/changelogs/fragments/test_ansibleundefined.yaml new file mode 100644 index 0000000..9f9d5f3 --- /dev/null +++ b/changelogs/fragments/test_ansibleundefined.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - Fixes test cases where there were assertion failure due to AnsibleUndefined path being changed. diff --git a/tests/unit/plugins/filter/test_ipaddr.py b/tests/unit/plugins/filter/test_ipaddr.py index 2849fb8..152e668 100644 --- a/tests/unit/plugins/filter/test_ipaddr.py +++ b/tests/unit/plugins/filter/test_ipaddr.py @@ -70,7 +70,8 @@ class TestIpFilter(TestCase): args = ["", AnsibleUndefined(name="my_ip"), ""] with pytest.raises( AnsibleFilterError, - match="Unrecognized type <> for ipaddr filter ", + # Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15 + match=r"Unrecognized type <> for ipaddr filter ", ): _ipaddr(*args) diff --git a/tests/unit/plugins/filter/test_ipv4.py b/tests/unit/plugins/filter/test_ipv4.py index 130ef6e..f3bdeaf 100644 --- a/tests/unit/plugins/filter/test_ipv4.py +++ b/tests/unit/plugins/filter/test_ipv4.py @@ -50,7 +50,8 @@ class TestIp4(TestCase): args = ["", AnsibleUndefined(name="my_ip"), ""] with pytest.raises( AnsibleFilterError, - match="Unrecognized type <> for ipv4 filter ", + # Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15 + match=r"Unrecognized type <> for ipv4 filter ", ): _ipv4(*args) diff --git a/tests/unit/plugins/filter/test_ipv6.py b/tests/unit/plugins/filter/test_ipv6.py index ad18bec..e088478 100644 --- a/tests/unit/plugins/filter/test_ipv6.py +++ b/tests/unit/plugins/filter/test_ipv6.py @@ -53,7 +53,8 @@ class TestIp6(TestCase): args = ["", AnsibleUndefined(name="my_ip"), ""] with pytest.raises( AnsibleFilterError, - match="Unrecognized type <> for ipv6 filter ", + # Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15 + match=r"Unrecognized type <> for ipv6 filter ", ): _ipv6(*args) diff --git a/tests/unit/plugins/filter/test_ipwrap.py b/tests/unit/plugins/filter/test_ipwrap.py index 8694fdb..a0c0aa4 100644 --- a/tests/unit/plugins/filter/test_ipwrap.py +++ b/tests/unit/plugins/filter/test_ipwrap.py @@ -55,7 +55,8 @@ class TestIpWrap(TestCase): args = ["", AnsibleUndefined(name="my_ip"), ""] with pytest.raises( AnsibleFilterError, - match="Unrecognized type <> for ipwrap filter ", + # Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15 + match=r"Unrecognized type <> for ipwrap filter ", ): _ipwrap(*args)