<commit_before>from sentinels import NOTHING

from .api_object import APIObject


class Test(APIObject):

    def report_end(self, duration=NOTHING, skipped=False):
        self.client.api.call_function('report_test_end', {'id': self.id, 'duration': duration, 'skipped': skipped})

    def add_error(self):
        return self.client.api.call_function('add_test_error', {'id': self.id})

    def add_failure(self):
        return self.client.api.call_function('add_test_failure', {'id': self.id})

    def add_metadata(self, metadata):
        return self.client.api.call_function('add_test_metadata', {'id': self.id, 'metadata': metadata})<commit_msg>separating skipped from end and adding interrupt API<commit_after>from sentinels import NOTHING

from .api_object import APIObject


class Test(APIObject):

    def report_end(self, duration=NOTHING):
        self.client.api.call_function('report_test_end', {'id': self.id, 'duration': duration})

    def mark_skipped(self):
        self.client.api.call_function('mark_skipped_test', {'id': self.id})

    def mark_interrupted(self):
        self.client.api.call_function('mark_interrupted_test', {'id': self.id})

    def add_error(self):
        return self.client.api.call_function('add_test_error', {'id': self.id})

    def add_failure(self):
        return self.client.api.call_function('add_test_failure', {'id': self.id})

    def add_metadata(self, metadata):
        return self.client.api.call_function('add_test_metadata', {'id': self.id, 'metadata': metadata})
{'fraction_non_alphanumeric': 0.13892529488859764, 'fraction_numerical': 0.0, 'mean_word_length': 4.552727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7344848', 'n_tokens_mistral': 488, 'n_tokens_neox': 472, 'n_words': 97}