code: def test_issue_26():
      context = {"success": False}
      promise1 = Promise(
          lambda resolve, reject: context.update(
              {"promise1_reject": reject}
          )
      )
      promise1.then(lambda x: None)
      promise1.then(lambda x: None)
      context["promise1_reject"](RuntimeError("Ooops!"))
  
      promise2 = Promise(
          lambda resolve, reject: context.update(
              {"promise2_resolve": resolve}
          )
      )
      promise3 = promise2.then(
          lambda x: context.update({"success": True})
      )
      context["promise2_resolve"](None)
  
      # We wait so it works in asynchronous envs
      promise3._wait(timeout=0.1)
      assert context["success"]
  
file_path: wandb/wandb/vendor/promise-2.3.0/tests/test_issues.py
imports: from concurrent.futures import ThreadPoolExecutor
  from promise import Promise
  import time
  import weakref
  import gc
label_desc: Use image node_id 6 for calling a global function with example usage: test_issue_26() without return types