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