@@ -208,7 +208,15 @@ def test_Request_open_username(urlopen_mock, install_opener_mock):
208208 if isinstance (handler , expected_handlers ):
209209 found_handlers .append (handler )
210210 assert len (found_handlers ) == 2
211- assert found_handlers [0 ].passwd .passwd [None ] == {(('ansible.com' , '/' ),): ('user' , None )}
211+
212+ expected = ('user' , None )
213+ result = found_handlers [0 ].passwd .passwd [None ]
214+
215+ assert (
216+ # see https://github.com/python/cpython/issues/155694
217+ result == {(('ansible.com' , '/' ),): expected } or # before fix
218+ result == {((None , 'ansible.com' , '/' ),): expected } # after fix
219+ )
212220
213221
214222def test_Request_open_username_in_url (urlopen_mock , install_opener_mock ):
@@ -226,7 +234,15 @@ def test_Request_open_username_in_url(urlopen_mock, install_opener_mock):
226234 for handler in handlers :
227235 if isinstance (handler , expected_handlers ):
228236 found_handlers .append (handler )
229- assert found_handlers [0 ].passwd .passwd [None ] == {(('ansible.com' , '/' ),): ('user2' , '' )}
237+
238+ expected = ('user2' , '' )
239+ result = found_handlers [0 ].passwd .passwd [None ]
240+
241+ assert (
242+ # see https://github.com/python/cpython/issues/155694
243+ result == {(('ansible.com' , '/' ),): expected } or # before fix
244+ result == {((None , 'ansible.com' , '/' ),): expected } # after fix
245+ )
230246
231247
232248def test_Request_open_username_force_basic (urlopen_mock , install_opener_mock ):
0 commit comments