@@ -86,13 +86,17 @@ def test_memorize(self):
8686 self .assertNotIn (authority , Authority ._domains_without_user_realm_discovery )
8787 a = Authority (authority , MinimalHttpClient (), validate_authority = False )
8888
89- # We now pretend this authority supports no User Realm Discovery
90- class MockResponse (object ):
91- status_code = 404
92- a .
user_realm_discovery (
"[email protected] " ,
response = MockResponse ())
93- self .assertIn (
94- "login.microsoftonline.com" ,
95- Authority ._domains_without_user_realm_discovery ,
96- "user_realm_discovery() should memorize domains not supporting URD" )
97- a .
user_realm_discovery (
"[email protected] " ,
98- response = "This would cause exception if memorization did not work" )
89+ try :
90+ # We now pretend this authority supports no User Realm Discovery
91+ class MockResponse (object ):
92+ status_code = 404
93+ a .
user_realm_discovery (
"[email protected] " ,
response = MockResponse ())
94+ self .assertIn (
95+ "login.microsoftonline.com" ,
96+ Authority ._domains_without_user_realm_discovery ,
97+ "user_realm_discovery() should memorize domains not supporting URD" )
98+ a .
user_realm_discovery (
"[email protected] " ,
99+ response = "This would cause exception if memorization did not work" )
100+ finally : # MUST NOT let the previous test changes affect other test cases
101+ Authority ._domains_without_user_realm_discovery = set ([])
102+
0 commit comments