@@ -192,7 +192,15 @@ def test_Request_open_username(urlopen_mock, install_opener_mock):
192192 if isinstance (handler , expected_handlers ):
193193 found_handlers .append (handler )
194194 assert len (found_handlers ) == 2
195- assert found_handlers [0 ].passwd .passwd [None ] == {(('ansible.com' , '/' ),): ('user' , None )}
195+
196+ expected = ('user' , None )
197+ result = found_handlers [0 ].passwd .passwd [None ]
198+
199+ assert (
200+ # see https://github.com/python/cpython/issues/155694
201+ result == {(('ansible.com' , '/' ),): expected } or # before fix
202+ result == {((None , 'ansible.com' , '/' ),): expected } # after fix
203+ )
196204
197205
198206@pytest .mark .parametrize ('url, expected' , (
@@ -215,7 +223,14 @@ def test_Request_open_username_in_url(url, expected, urlopen_mock, install_opene
215223 for handler in handlers :
216224 if isinstance (handler , expected_handlers ):
217225 found_handlers .append (handler )
218- assert found_handlers [0 ].passwd .passwd [None ] == {(('ansible.com' , '/' ),): expected }
226+
227+ result = found_handlers [0 ].passwd .passwd [None ]
228+
229+ assert (
230+ # see https://github.com/python/cpython/issues/155694
231+ result == {(('ansible.com' , '/' ),): expected } or # before fix
232+ result == {((None , 'ansible.com' , '/' ),): expected } # after fix
233+ )
219234
220235
221236def test_Request_open_username_force_basic (urlopen_mock , install_opener_mock ):
0 commit comments