Пример #1
0
    def execute(self):
        start = int(time.time() * 1000)
        data = {
        "suite": self,
        "timestamp": start
        }

        Publisher.notify(Events.SUITE_STARTED, data)

        status = self._execute()

        # TODO: add more info (number of tests, passed/failed, etc)
        data = {"suite": self,
                "status": status,
                "start_time": start,
                "timestamp": int(time.time() * 1000)}

        Publisher.notify(Events.SUITE_ENDED, data)
Пример #2
0
    def execute(self):
        start = int(time.time() * 1000)
        data = {"test_script": self, "timestamp": start}

        Publisher.notify(Events.TEST_STARTED, data)

        # TODO: also generate events for each execution block: setup, iterations, tear_down

        status, exceptions = self._execute()

        data = {
            "test_script": self,
            "status": status,
            "start_time": start,
            "exception": exceptions,
            "timestamp": int(time.time() * 1000),
        }

        Publisher.notify(Events.TEST_ENDED, data)

        if status == "FAILED" and exceptions:
            raise exceptions[0][0], exceptions[0][1], exceptions[0][2]