code: def test_px_blocking(self):
      ip = get_ipython()
      v = self.client[-1:]
      v.activate()
      v.block = True
  
      ip.run_line_magic("px", "a=5")
      assert v["a"] == [5]
      ip.run_line_magic("px", "a=10")
      assert v["a"] == [10]
      # just 'print a' works ~99% of the time, but this ensures that
      # the stdout message has arrived when the result is finished:
      with capture_output() as io:
          ip.run_line_magic(
              "px",
              "import sys,time;print(a);sys.stdout.flush();time.sleep(0.2)",
          )
      assert "[stdout:" in io.stdout
      assert "\n\n" not in io.stdout
      assert io.stdout.rstrip().endswith("10")
  
imports: import re
  import signal
  import sys
  import time
  import pytest
  from IPython import get_ipython
  from IPython.utils.io import capture_output
  import ipyparallel
  from ipyparallel import AsyncResult
  from .clienttest import ClusterTestCase, generate_output, raises_remote
label_desc: Use image node_id 1 for calling the TestParallelMagics obj's underlying member method code with example usage: obj.test_px_blocking() without return types