code: def test_print_results_with_metrics_filename(self):
      kebab_args = [
          "__main__.py",
          "print-results",
          str(self.TEST_DIR),
          "--keys",
          "train",
          "dev",
          "test",
          "--metrics-filename",
          "cool_metrics.json",
      ]
      sys.argv = kebab_args
      with io.StringIO() as buf, redirect_stdout(buf):
          main()
          output = buf.getvalue()
  
      lines = output.strip().split("\n")
      assert lines[0] == "model_run, train, dev, test"
  
      expected_results = {
          (str(self.directory3) + "/cool_metrics.json", "6", "7", "N/A")
      }
      results = {tuple(line.split(", ")) for line in lines[1:]}
      assert results == expected_results
  
file_path: allennlp/tests/commands/print_results_test.py
imports: import os
  import json
  import sys
  import pathlib
  import tempfile
  import io
  from contextlib import redirect_stdout
  from allennlp.commands import main
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 3 for calling the TestPrintResults obj's underlying member method code with example usage: obj.test_print_results_with_metrics_filename() without return types