@@ -786,20 +786,26 @@ def create_release(self, tag_name, target_commitish=None, name=None,
786786 return Release (json , self )
787787
788788 @requires_auth
789- def create_status (self , sha , state , target_url = '' , description = '' , context = '' ):
789+ def create_status (self , sha , state , target_url = None , description = None ,
790+ context = 'default' ):
790791 """Create a status object on a commit.
791792
792793 :param str sha: (required), SHA of the commit to create the status on
793794 :param str state: (required), state of the test; only the following
794795 are accepted: 'pending', 'success', 'error', 'failure'
795796 :param str target_url: (optional), URL to associate with this status.
796797 :param str description: (optional), short description of the status
798+ :param str context: (optional), A string label to differentiate this
799+ status from the status of other systems
800+ :returns: the status created if successful
801+ :rtype: :class:`~github3.repos.status.Status`
797802 """
798- json = {}
803+ json = None
799804 if sha and state :
800805 data = {'state' : state , 'target_url' : target_url ,
801806 'description' : description , 'context' : context }
802807 url = self ._build_url ('statuses' , sha , base_url = self ._api )
808+ self ._remove_none (data )
803809 json = self ._json (self ._post (url , data = data ), 201 )
804810 return Status (json ) if json else None
805811
0 commit comments