@@ -238,16 +238,16 @@ def test_actor_get_uid_laziness_not_called(self, mock_get_uid):
238238 @mock .patch ("getpass.getuser" )
239239 def test_actor_get_uid_laziness_called (self , mock_get_uid ):
240240 mock_get_uid .return_value = "user"
241- for cr in ( None , self . rorepo . config_reader ()):
242- committer = Actor .committer ( cr )
243- author = Actor . author ( cr )
244- if cr is None : # otherwise, use value from config_reader
245- self .assertEqual (committer .name , 'user' )
246- self .assertTrue (committer .email .startswith ('user@' ))
247- self .assertEqual (author .name , 'user' )
248- self .assertTrue (committer .email .startswith ('user@' ))
241+ committer = Actor . committer ( None )
242+ author = Actor .author ( None )
243+ # We can't test with `self.rorepo.config_reader()` here, as the uuid laziness
244+ # depends on whether the user running the test has their user.name config set.
245+ self .assertEqual (committer .name , 'user' )
246+ self .assertTrue (committer .email .startswith ('user@' ))
247+ self .assertEqual (author .name , 'user' )
248+ self .assertTrue (committer .email .startswith ('user@' ))
249249 self .assertTrue (mock_get_uid .called )
250- self .assertEqual (mock_get_uid .call_count , 4 )
250+ self .assertEqual (mock_get_uid .call_count , 2 )
251251
252252 def test_actor_from_string (self ):
253253 self .assertEqual (Actor ._from_string ("name" ), Actor ("name" , None ))
0 commit comments