예제 #1
0
    def test_simple_skip(self, user_code_detector):
        try:
            raise_example_failure("test")
        except Exception:
            tbvaccine = TBVaccine(
                user_code_detector=user_code_detector, skip_non_user_on_isolate=True
            )
            exception_message = tbvaccine.format_tb(*sys.exc_info())
            print(exception_message)

            assert "test_simple_skip" not in exception_message
예제 #2
0
    def format_exception_as_str(self, exc_info, isolate=True):
        if self.exception_simple:
            return format_exception_as_str(exc_info)

        try:
            tbvaccine = TBVaccine(
                no_colors=self.exception_no_color,
                show_vars=False,
                skip_non_user_on_isolate=True,
                isolate=isolate,
            )
            return tbvaccine.format_tb(*exc_info)
        except Exception as ex:
            logger.info("Failed to format exception: %s", ex)
            return format_exception_as_str(exc_info)