# Path: importer/tests/utils.py
# @contextmanager
# def capture_output():
#     real_stdout, real_stderr = sys.stdout, sys.stderr
#     try:
#         sys.stdout, sys.stderr = StringIO(), StringIO()
#         yield sys.stdout, sys.stderr
#     finally:
#         sys.stdout, sys.stderr = real_stdout, real_stderr


from unittest import TestCase
from importer.utils.decorators import safe_crash, maybe
from importer.utils.collections import find_first
from importer.utils.strings import strip_links
from .utils import capture_output




class SafeCrashTestCase(TestCase):
    def test_doesnt_actually_crash_on_exception(self):
        with capture_output():
            try:
                self.crashing_function()
            except:
                self.fail()

    def test_prints_traceback(self):

# Path: importer/tests/utils.py
# @contextmanager
# def capture_output():
#     real_stdout, real_stderr = sys.stdout, sys.stderr
#     try:
#         sys.stdout, sys.stderr = StringIO(), StringIO()
#         yield sys.stdout, sys.stderr
#     finally:
#         sys.stdout, sys.stderr = real_stdout, real_stderr


# Path: importer/tests/test_utils.py
from unittest import TestCase
from importer.utils.decorators import safe_crash, maybe
from importer.utils.collections import find_first
from importer.utils.strings import strip_links
from .utils import capture_output





class SafeCrashTestCase(TestCase):
    def test_doesnt_actually_crash_on_exception(self):
        with capture_output():
            try:
                self.crashing_function()
            except:
                self.fail()

    def test_prints_traceback(self):

        with capture_output() as (stdout, stderr):