def test_return_locals_debugger_events(self):
        def collect_events(func):
            events = []
            def tracer(frame, event, args):
                events.append((frame.f_code, event))
                return tracer
            old_tracer = sys.gettrace()
            sys.settrace(tracer)
            try:
                func()
            finally:
                sys.settrace(old_tracer)
            return events
        def inner():
            return 2
        def outer():
            a = 1
            b = inner()
        events1 = set(collect_events(outer))
        events2 = set(collect_events(return_locals(outer)))
        self.assertTrue(events2.issuperset(events1))
Get the returns for the command line interface via the event system
dataset/ETHPy150Open SmartTeleMax/iktomi/tests/unstable/utils/functools.py/Tests.test_return_locals_debugger_events--crossover with--dataset/ETHPy150Open saltstack/salt/salt/client/__init__.py/LocalClient.get_cli_static_event_returns