88
99from pytest_ansible .results import ModuleResult
1010
11- from .conftest import ALL_EXTRA_HOSTS , ALL_HOSTS
11+ from .conftest import ALL_EXTRA_HOSTS , ALL_HOSTS , skip_ansible_219
1212
1313
1414invalid_hosts = [
@@ -28,20 +28,23 @@ def create_hosts(): # type: ignore[no-untyped-def] # noqa: ANN202
2828 return create_hosts
2929
3030
31+ @skip_ansible_219
3132def test_len (adhoc_result ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
3233 adhoc_result_ret , include_extra_inv = adhoc_result ()
3334 assert len (adhoc_result_ret ) == len (ALL_HOSTS ) + len (
3435 ALL_EXTRA_HOSTS if include_extra_inv else [],
3536 )
3637
3738
39+ @skip_ansible_219
3840def test_keys (adhoc_result ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
3941 adhoc_result_ret , include_extra_inv = adhoc_result ()
4042 assert set (adhoc_result_ret ) == set (
4143 ALL_HOSTS + (ALL_EXTRA_HOSTS if include_extra_inv else []),
4244 )
4345
4446
47+ @skip_ansible_219
4548def test_items (adhoc_result ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
4649 adhoc_result_ret , include_extra_inv = adhoc_result ()
4750 items = adhoc_result_ret .items ()
@@ -54,6 +57,7 @@ def test_items(adhoc_result): # type: ignore[no-untyped-def] # noqa: ANN001, A
5457 assert count == len (ALL_HOSTS + (ALL_EXTRA_HOSTS if include_extra_inv else []))
5558
5659
60+ @skip_ansible_219
5761def test_values (adhoc_result ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
5862 adhoc_result_ret , include_extra_inv = adhoc_result ()
5963 values = adhoc_result_ret .values ()
@@ -67,6 +71,7 @@ def test_values(adhoc_result): # type: ignore[no-untyped-def] # noqa: ANN001,
6771
6872
6973@pytest .mark .parametrize ("host" , ALL_HOSTS + ALL_EXTRA_HOSTS )
74+ @skip_ansible_219
7075def test_contains (adhoc_result , host ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
7176 adhoc_result_ret , include_extra_inv = adhoc_result ()
7277 if not include_extra_inv and host in ALL_EXTRA_HOSTS :
@@ -76,12 +81,14 @@ def test_contains(adhoc_result, host): # type: ignore[no-untyped-def] # noqa:
7681
7782
7883@pytest .mark .parametrize ("host" , invalid_hosts )
84+ @skip_ansible_219
7985def test_not_contains (adhoc_result , host ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
8086 adhoc_result_ret , dummy = adhoc_result ()
8187 assert host not in adhoc_result_ret
8288
8389
8490@pytest .mark .parametrize ("host_pattern" , ALL_HOSTS + ALL_EXTRA_HOSTS )
91+ @skip_ansible_219
8592def test_getitem (adhoc_result , host_pattern ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
8693 adhoc_result_ret , include_extra_inv = adhoc_result ()
8794 if not include_extra_inv and host_pattern in ALL_EXTRA_HOSTS :
@@ -93,13 +100,15 @@ def test_getitem(adhoc_result, host_pattern): # type: ignore[no-untyped-def] #
93100
94101
95102@pytest .mark .parametrize ("host_pattern" , invalid_hosts )
103+ @skip_ansible_219
96104def test_not_getitem (adhoc_result , host_pattern ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
97105 adhoc_result_ret , dummy = adhoc_result ()
98106 with pytest .raises (KeyError ):
99107 assert adhoc_result_ret [host_pattern ]
100108
101109
102110@pytest .mark .parametrize ("host_pattern" , ALL_HOSTS + ALL_EXTRA_HOSTS )
111+ @skip_ansible_219
103112def test_getattr (adhoc_result , host_pattern ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
104113 adhoc_result_ret , include_extra_inv = adhoc_result ()
105114 if not include_extra_inv and host_pattern in ALL_EXTRA_HOSTS :
@@ -110,6 +119,7 @@ def test_getattr(adhoc_result, host_pattern): # type: ignore[no-untyped-def] #
110119
111120
112121@pytest .mark .parametrize ("host_pattern" , invalid_hosts )
122+ @skip_ansible_219
113123def test_not_getattr (adhoc_result , host_pattern ): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
114124 adhoc_result_ret , dummy = adhoc_result ()
115125 assert not hasattr (adhoc_result_ret , host_pattern )
@@ -118,6 +128,7 @@ def test_not_getattr(adhoc_result, host_pattern): # type: ignore[no-untyped-def
118128
119129
120130@pytest .mark .requires_ansible_v2
131+ @skip_ansible_219
121132def test_connection_failure_v2 (): # type: ignore[no-untyped-def] # noqa: ANN201, D103
122133 from pytest_ansible .errors import AnsibleConnectionFailure
123134 from pytest_ansible .host_manager .utils import get_host_manager
@@ -142,6 +153,7 @@ def test_connection_failure_v2(): # type: ignore[no-untyped-def] # noqa: ANN20
142153
143154
144155@pytest .mark .requires_ansible_v2
156+ @skip_ansible_219
145157def test_connection_failure_extra_inventory_v2 (): # type: ignore[no-untyped-def] # noqa: ANN201, D103
146158 from pytest_ansible .errors import AnsibleConnectionFailure
147159 from pytest_ansible .host_manager .utils import get_host_manager
0 commit comments