code: def test_basic_script_with_output_before(capsys: Capture) -> None:
      def run(dirname: str) -> None:
          with WorkingDir(dirname):
              main(
                  [
                      "bokeh",
                      "json",
                      "--output",
                      "foo.json",
                      "scatter.py",
                  ]
              )
          out, err = capsys.readouterr()
          assert err == ""
          assert out == ""
  
          assert {"foo.json", "scatter.py"} == set(os.listdir(dirname))
  
      with_directory_contents({"scatter.py": basic_scatter_script}, run)
  
file_path: bokeh/tests/unit/bokeh/command/subcommands/test_json__subcommands.py
imports: from __future__ import annotations
  import pytest
  import argparse
  import os
  from bokeh.command.bootstrap import main
  from bokeh.command.subcommand import Argument
  from tests.support.util.filesystem import TmpDir, WorkingDir, with_directory_contents
  from tests.support.util.types import Capture
  from _util_subcommands import basic_scatter_script
  import bokeh.command.subcommands.json
label_desc: Use image node_id 8 for calling a global function with example usage: test_basic_script_with_output_before(capsys) without return types